Scopes
JavaScript variables are only accessible under certain circumstances. While scope is any part of a program where a binding between a variable and value is valid,'lexical scope' refers to the regions in your code where you can refer to a variable directly by its name.
Global Scope
In a simple program without any . . .
Bitwise Operators
Pretty much everything in a computer is represented by a series of 1s and 0s called 'bits'. Bitwise operations directly manipulate these bits.
The Base 2 Number System
The counting that you would normally do every day is done in base 10, meaning that each place in the number can hold one of ten values (0 to 9).
. . .
JavaScript Subroutines
Functions are Objects
One of the most important things to understand about JavaScript (and functional languages in general) is that all functions (a) exist as objects and (b) are dynamic. By comparison, there are compiled languages (e.g. Java) that have functions acting as class or instance methods, and are referenced with static . . .
The DOM (Document Object Model) Tree
Traversal, parents, siblings, and children
The DOM (Document Object Model) is a tree-like structure model of the page that is created by the browser when a web page is loaded. It’s a W3C (World Wide Web Consortium) standard that defines a standard for accessing documents:
The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows . . .
Recursion
I recently saw recursion explained by way of unstacking Babushka dolls and thought it was a great way of visualizing the process. Each doll is made up of the small doll within it, all the way down to the smallest doll. Essentially this follows the same pattern as recursive algorithm, where we solve a problem by solving a smaller instance of . . .
Understanding _.invoke
In order to be able to understand how invoke works, I first had to do a bit of research on Javascript’s apply method. Apply is one of the most often used Function methods, as it calls a function with a given this value and a single array (or array-like object) of arguments. Apply is especially useful because you don’t have to know the . . .