Postgresql Index Array Javascript Iteration Methods Javascript