Para JS, se establece una matriz de texto en la variable arr :
let arr = ["When I consider every thing that grows", "", "Holds in perfection but a little moment,", "", "That this huge stage presenteth nought but shows", "", "Whereon the stars in secret influence comment;"];Cómo quitarle las líneas vacías y que quede como una matriz, pero sin las cadenas vacías:

Puedes usar un filtro booleano para esto:
arr.filter(Boolean)Código completo:
let arr = [ "When I consider every thing that grows", "", "Holds in perfection but a little moment,", "", "That this huge stage presenteth nought but shows", "", "Whereon the stars in secret influence comment;" ]; console.log(arr.filter(Boolean));me da:
[ "When I consider every thing that grows", "Holds in perfection but a little moment,", "That this huge stage presenteth nought but shows", "Whereon the stars in secret influence comment;" ]