If Not Empty Array Javascript Iteration