Javascript Iterating Through Array Javascript Methods