What is a Closure? In JavaScript, a closure is an inner function that has access to the outer function’s variables. The closure has three scope chains: it has access to its own scope, it has access to the outer function’s variables, and it has access to the global variables. (For more on JavaScript scoping, check […]
Variable Scope and Hoisting in JavaScript

What is Scope? A variable’s scope determines which parts of the program can see and use it. JavaScript has global and local scopes. Any variable declared outside of any functions belongs to the global scope. It is accessible from anywhere in your code. Defining a function creates its own local scope, meaning the variable can […]
Using CSS transforms to create a slanted layout

Web page layouts naturally tend toward stacks of rectangles, but we can easily create other shapes with CSS. In particular, using the skew property of a CSS transform, we can make a slanted layout. CSS transforms can change the shape, position, or orientation of the elements to which they’re applied. The skew property lets us […]