Postgresql Create Json Array From Nodelist Javascript W3schools