Every Method on globalThis in JS

In JavaScript, globalthis carries a long list of methods. This page is meant to serve as a companion to the JS Methods article. There we have every method in JavaScript sorted by the object the method is attached to. The only thing not included there is globalThis. Given the 1,500+ methods on globalThis, and the fact that they are all  MORE q

By on May 18th, 2020 in

All Errors in JavaScript

Error: Permission denied to access property "x"InternalError: too much recursionRangeError: argument is not a valid code pointRangeError: invalid array lengthRangeError: invalid dateRangeError: precision is out of rangeRangeError: radix must be an integerRangeError: repeat count must be less than infinityRangeError: repeat count must be non-negativeReferenceError: "x" is not definedReferenceError: assignment to undeclared variable "x"ReferenceError: can't access…  MORE q

By on May 8th, 2020 in

Spread & Rest in JavaScript

The spread operator allows for an Object's properties to be filled into a another object right in line with existing properties. Likewise, this can fill one array in another array keeping the values in line with existing values. Spread const aNewObject = {...oldObject} const aNewArray = [...oldArray] Rest The rest parameter an array made  MORE q

By on April 18th, 2020 in

Map Data Structure in JavaScript

The Map object holds key-value pairs like a standard object. There are a few significant differences between Map and a regular key-value pair object. These are: Objects: Keys must be obtained and used to iterate over. Map: This is iterable, meaning we can directly iterate. Objects: The key can only be an integer, string, or symbol. Map: Key field can be of any data-type including objects and functions. Objects: Retrieving size is a manual process. Map: The size property hold this info. Objects: Iterating will not always return keys in  MORE q

By on April 17th, 2020 in

Asynchronous Code with JS

A promise returns the same data as a callback function, but can await the reply. With this, when there is a delay receiving data, the syntax is nicer and the better error handing. Most importantly, the browser can continue processing the page and then fill in the delayed data whenever it is ready. The above allows for JavaScript to step away from the normal synchronous processing order, which is running commands one after the other in the order   MORE q

By on April 17th, 2020 in

Scope in JavaScript

In English, "scope" is defined as: "The extent of the area that something is relevant". In JavaScript, this definition holds, with one small adjustment: "The extent of the area that something is accessible". With this in mind there are two basic areas with which a variable can be contained and is accessible: globally and locally. Global Scope Variables with global scope are part of the global object. In a web browser, this  MORE q

By on April 16th, 2020 in

Post Navigation