Java While Loop Through An Array Javascript Mdn