Javascript Foreach Create Array In Python Code For Snake