
JavaScript Global object
1. Overview The global object provides variables and functions that are available anywhere. By default, those that are built into the language or the environment. […]
1. Overview The global object provides variables and functions that are available anywhere. By default, those that are built into the language or the environment. […]
This article is for understanding old scripts The information in this article is useful for understanding old scripts. That’s not how we write a new […]
JavaScript is a very function-oriented language. It gives us a lot of freedom. A function can be created at any moment, passed as an argument […]
Many JavaScript built-in functions support an arbitrary number of arguments. For instance: Math.max(arg1, arg2, …, argN) – returns the greatest of the arguments. Object.assign(dest, src1, …, […]
Let’s return to functions and study them more in-depth. Our first topic will be recursion. If you are not new to programming, then it is probably […]
Let’s say we have a complex object, and we’d like to convert it into a string, to send it over a network, or just to […]
Let’s meet a new built-in object: Date. It stores the date, time and provides methods for date/time management. For instance, we can use it to store […]
The two most used data structures in JavaScript are Object and Array. Objects allow us to create a single entity that stores data items by key. Arrays allow […]
Let’s step away from the individual data structures and talk about the iterations over them. In the previous chapter we saw methods map.keys(), map.values(), map.entries(). These methods are […]
1. Overview As we know from the chapter Garbage collection, JavaScript engine keeps a value in memory while it is “reachable” and can potentially be used. […]
Till now, we’ve learned about the following complex data structures: Objects are used for storing keyed collections. Arrays are used for storing ordered collections. But […]
Iterable objects are a generalization of arrays. That’s a concept that allows us to make any object useable in a for..of loop. Of course, Arrays are iterable. But […]
Arrays provide a lot of methods. To make things easier, in this chapter they are split into groups. 1. Add/remove items We already know methods […]
Objects allow you to store keyed collections of values. That’s fine. But quite often we find that we need an ordered collection, where we have a […]
In JavaScript, the textual data is stored as strings. There is no separate type for a single character. The internal format for strings is always UTF-16, […]
In modern JavaScript, there are two types of numbers: Regular numbers in JavaScript are stored in 64-bit format IEEE-754, also known as “double precision floating point […]
1. Overview JavaScript allows us to work with primitives (strings, numbers, etc.) as if they were objects. They also provide methods to call as such. […]
What happens when objects are added obj1 + obj2, subtracted obj1 – obj2 or printed using alert(obj)? JavaScript doesn’t exactly allow to customize how operators work on objects. Unlike […]
By specification, object property keys may be either of string type, or of symbol type. Not numbers, not booleans, only strings or symbols, these two […]
A recent additionThis is a recent addition to the language. Old browsers may need polyfills. The optional chaining ?. is a safe way to access nested object […]