From PHP using single quotes for the line break worked for me to support the line breaks when I pass that var to an HTML text area value attribute
PHP
foreach ($videoUrls as $key => $value) {
$textAreaValue .= $value->video_url . '\n';
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HTML/JS
$( document ).ready(function() {
var text = "<?= htmlspecialchars($textAreaValue); ?>";
document.getElementById("video_urls_textarea").value = text;
});