Create array from line-terminated string on browser