Mindblown: a blog about philosophy.

  • JavaScript Object.keys, Values, Entries

    In this chapter, we are going to cover Object.keys, values, and entries. We have already spoken about methods such as map.keys(), map.values(), map.entries(). These methods are universal and are used for data structures. Every time after creating a data structure, they should also be implemented. They are mainly used for Map, Set, and Array. Similar methods are supported by plain…

  • JavaScript WeakMap and WeakSet

    In chapter Garbage Collection, it was stated that the JavaScript engine can store a value in memory once it is reachable. As a rule, properties or elements of data structures such as an object or an array are reachable and kept in memory once that data structure is in memory. For example, after putting an object into an array, it will exist…

  • JavaScript‌ ‌Map‌ ‌and‌ ‌Set‌ ‌

    While‌ ‌working‌ ‌with‌ ‌‌JavaScript‌,‌ ‌developers‌ ‌waste‌ ‌a‌ ‌lot‌ ‌of‌ ‌time‌ ‌on‌ ‌choosing‌ the‌ ‌right‌ ‌data‌ ‌structure.‌‌ Objects‌‌ ‌and‌ ‌‌ Arrays‌‌ ‌are‌ ‌the‌ ‌primary‌ ‌data‌ ‌structures‌ ‌used‌ ‌to‌ ‌store‌ ‌collections‌ ‌of‌ ‌data.‌ ‌Objects‌ ‌are‌ ‌used‌ ‌for‌ ‌storing‌ ‌key/value‌ ‌pairs,‌ ‌and‌ ‌arrays-‌ ‌for‌ ‌indexed‌ ‌lists.‌ ‌ ‌ To‌ ‌make‌ ‌developers’‌ ‌life‌ ‌easier,‌ ‌ECMAScript‌ ‌2015‌ ‌represented‌ ‌two‌ ‌new‌ ‌kinds‌ ‌ of‌…

  • JavaScript Iterables

    The protocol of iterations enables JavaScript objects to define and customize their iteration behavior like what values are looped over in for…of. Arrays are considered iterable. But, there are also other iterables (for instance, strings). Describing Symbol.iterator Let’s try to create an iterable. For instance, there is an object, which is not an array but can be suitable for for…of.…

  • JavaScript Array methods

    In JavaScript, there exist a wide range of array methods. To give you more detailed and comprehensive information, we are going to split them into groups. Add/Remove Methods In chapter Arrays, we have already spoken about this group of methods. Among them are: arr.push(…items)– helps to add items to the end; arr.pop()– extracting an item from…

  • JavaScript Arrays

    In this chapter, we will explore JavaScript arrays. In JavaScript, you can use arrays for storing multiple values in a single variable. We can describe an array as a unique variable capable of holding more than one value simultaneously. There exist two syntaxes for generating an empty array: The second syntax is used most of…

  • JavaScript Strings

    In JavaScript, the strings are used for storing and manipulating text. No separate type exists for a single character. The strings internal format is always UTF-16. A string represents zero or more characters that are written inside quotes. About Quotes We can distinguish single quotes, double quotes, and backticks: Double and single quotes are the same. Anyway, backticks are different.…

  • Javascript Math

    In JavaScript, Math is a built-in object. It has both properties and methods for mathematical functions and constants. Math operates with the Number type, but never with BigInt. Unlike other global objects, Math is not considered a constructor. The methods and properties of Math are fixed. You can call them by applying Math as an object without creating it. So, you refer to constant pi as Math.PI. Hence,…

  • JavaScript Numbers

    Two types of numbers can be highlighted in modern JavaScript: Regular and bigInt. Regular ones are stored in the format of 64-bit IEEE-754. It is also known as “double-precision floating-point numbers”. Developers use these numbers most in their practice. BigInt numbers are used for representing integers of arbitrary length. We only use them in a…

  • JavaScript Methods of Primitives

    In JavaScript, it is possible to work with primitives (numbers, strings, and more), as if they were objects. But, of course, there are notable differences between objects and primitives. So, primitive is a primitive type value. Seven types of primitives exist, among them are: number, bigint, symbol, string, boolean, null and undefined. An object can store multiple values as properties. You can create an object using {}. For example: Other kinds…

Got any book recommendations?