The Variable Crimes We Commit Against JavaScript

Mobile & Web

Julka Grodel

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 effected? 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 effects variables in your functions.

Depending on time, this might just talk about ES5 scopes, or I might be able to go into ES6 and TypeScript.

Scopes in JavaScript are a misunderstood aspect by many developers and cab create frustration when troubleshooting code. This talk doesn’t require any knowledge of JavaScript specifically, but a proficiency in some programming language is helpful.