Foreach Array Object Javascript Mdn Math Function In Java