Javascript Foreach Loop Through Array Python Definition