The Code Log

Code notes and snippets resource for software development concepts

In JavaScript, statements are like sentences, expressions are like phrases and operators are like punctuation. The following are examples to show ways in which these…

Read more

JavaScript modules enable multiple scopes to share code. Modules use closures to keep things private and only make public certain things. Below a function is…

Read more

In JavaScript, objects are the only construct. Each object has a special private property [[Prototype]], that is either null or links to another object called…

Read more

The value of this has nothing to do with where a function is declared but instead is determined by how a function is called. It…

Read more

An Immediately Invoked Function Expressions (IIFE) is a JavaScript function that runs as soon as it is defined. Since the keyword function does not come…

Read more

A closure occurs when a function is able to remember and access its lexical scope even when that function is executing outside its lexical scope….

Read more

Variables declared with var do not have block scope. This is because block statements do not introduce a scope and the var keyword attaches variables…

Read more

JavaScript has a very sophisticated compiler that checks hundreds of lines of code in milliseconds to see if it contains any errors. If there is…

Read more

In JavaScript, a variable may store two types of data: primitive and reference. When you assign a variable a value, the JavaScript engine must determine…

Read more

JavaScript has the following types of operators: An assignment operator assigns a value to its left operand based on the value of its right operand:…

Read more