Javascript Iterate Over Array In Javascript Definition