Variables without var
- Works, variable are global here too.
- What if we make a typo in one of the variable names? No one might notice, but the code will misbehave.
examples/js/no_var.js
colour = "green"; console.log(colour); // green paint_house(); console.log(colour); // green // There are lots of lines of code here. // So many lines that the next part is on another page: function paint_house() { color = "blue"; }