Category: 5. JavaScript Objects

  • Tagged Templates

    JavaScript Tagged Templates The tagged templates in JavaScript are an advanced version of the template literals. You can define the function to format the string and use it with a template literal to format the string according to the functionality of the function. The tagged template can be used with the string using the function…

  • Tempate Literals

    JavaScript Tempate Literals In JavaScript, the template literals are introduced in ES6 to customize the string dynamically. The template literals allow you to add variables or expressions into the string, and the string changes according to the variables and expression value changes. There are multiple synonyms words used for the template literal words. For example, template string,…

  • The TypedArray Object

    What is a TypedArray? A JavaScript TypedArray is an array-like object used to store binary data. Unlike the array, the size of the TypedArray can’t be dynamic and can’t hold the values of the different data types, improving the performance of the TypedArray. A TypedArray is used in audio processing, graphics rendering, networking, etc. Why…

  •  The Iterables Object

    In JavaScript, iterables are objects that can be iterated through using the for…of loop. They can also be iterated over using other methods like forEach(), map(), etc. Basically, you can traverse through each element of the iterable in JavaScript. Here are some examples of the common iterables. Iterate using the for…of loop In this section,…

  • The WeakMap Object

    A WeakMap object in JavaScript is a collection of key-value pairs where the keys are weakly referenced. The WeakMap keys must be objects or non-registered symbols, and values are of any arbitrary JavaScript type. The WeakMap is similar to the JavaScript Map. The main difference between the WeakMap and Map data structure is that the WeakMap data…

  •  The Maps Object

    A Map object in JavaScript is a collection of key-value pairs where the keys can be of any type, including objects or functions. The order of the map elements is the same as the insertion order of the key-value pairs. To create a new Map object, you can use the new Map() constructor. You can then add…

  • The WeakSet Object

    The JavaScript WeakSet object is a collection of objects. The WeakSet is very similar to the Set. The main difference between the WeakSet and Set is that the WeakSet contains only objects, and the Set can also contain the values like numbers, Boolean, string, etc. WeakSet objects are weak, meaning that references to objects in…

  • Sets

    A JavaScript Set object is a collection of unique values. Each value can only occur once in a Set. A Set can hold any value of any data type. The sets are introduced to JavaScript in ECMAScript 6 (ES6). JavaScript Sets are similar to Arrays, but there are some key differences: JavaScript Sets are often used to store unique…

  • The Symbol Object

    JavaScript Symbol In JavaScript, Symbol is a primitive data type and it was introduced in ECMAScript 6 (ES6). It can be created using the ‘Symbol’ constructor. Symbols are immutable and unique, unlike to other primitive data types like strings or numbers. They are especially helpful in situations where a unique identifier is required since they offer a…

  • Regular Expressions and RegExp Object

    A regular expression (RegExp) in JavaScript is an object that describes a pattern of characters. It can contain the alphabetical, numeric, and special characters. Also, the regular expression pattern can have single or multiple characters. The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on…