Learning JavaScript from PHP - a Comparison | Lullabot - 0 views
-
In PHP, all variables are local in scope unless declared as global. JavaScript is opposite, and all variables are global unless declared with the var keyword.
-
Both PHP and JavaScript are loosely typed
-
JavaScript is a bit mixed concerning undeclared variables, if you attempt to modify or compare with an undeclared variable, the script will break entirely, but you can check the variable status using typeof() or in conditional statements containing only that variable.
- ...6 more annotations...