The Variable Crimes We Commit Against JavaScript

Ballroom

Have you ever put a value into a JavaScript variable, and then been unable to use it where you needed it? Or created it and unintentionally overridden something you thought wouldn’t be affected? JavaScript has an unusual way of handling where variables are available; we call this “where” a scope. In this talk, we’ll go over how JavaScript variables ‘bubble’ up into higher scopes, how to restrict them to just where you want them, and how this affects variables in your functions.

All Levels