Foreach-as(PHP) vs for-in(Javascript) and other differences between PHP and javascript


#1

okay so I tried to learn javascript first, and I was having trouble with contact list exercise from javascript. So i decided to learn something new and went to learn PHP. I completed it today, and now I decided to resume learning javascript from where I left off. I noticed that there are some similarities, and instead of making a lot of topics about it, I decided to put them all in this one.

1- Is foreach-as(PHP) same as for-in loop(Javascript) ?
2- "key"=>"value" for PHP and "key":"value" for javascript. am I right?(in objects)


#2

google search
For
== discussions / opinions ==
foreach(PHP) vs for-in loop(Javascript) site:stackoverflow.com