Category: Intermediate JavaScript

Recent Post

Insert an element or HTML block before or after an existing element

Using the insertAdjacentElement() or insertAdjacentHTML() methods.

What’s wrong with using ‘var’ in JavaScript?

Using 'var' to declare variables can lead to scope leakage and silent errors in your code.

Emptying a JavaScript array

Emptying an array is easy, but methods vary in their impact on references made to the array in other

Find the index of an element in a JavaScript array by value

Get the index value of any element in an array by value and instance of its appearance.

Self-executing functions in JavaScript

Self-executing functions are ideal for making a one-time process self-contained.

Higher-order array methods with simple examples: map, filter, sort and reduce

Use flexible higher-order array methods to help achieve your programming objectives.

All you need to know about JavaScript arrow functions

Arrow functions use efficient syntax but are best avoided when using "this"

The symbol data type: syntax and use cases

The symbol type prevents object key clashes and can help protect private data

Object destructuring: storing data from JS objects in variables

Easily extract properties from objects and store them in variables

Convert a JavaScript object to an array with Object.entries()

Easily convert a JS object to an array using the Object.entries() method.