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

Classes in JavaScript

Classes are blueprints to create Objects. When a class is set up with all of the properties and functions for the object, this class can then be used to create any number of identical Objects. Important notes on classes : It is common to capitalize the first letter of the class name to make clear it is a class and  MORE q

By on April 12th, 2020 in

Literals in JavaScript

Literal in programming: In computer science, a literal is a notation for representing a fixed value in source code. In JavaScript, it would be closed by { } or [ ]. Object Literal: This would be closed by { } and have a key(String or Number) and a value (any type) separated by a colon with each entry   MORE q

By on April 12th, 2020 in

Arrays in Javascript

Arrays in JavaScript are versatile structures for storing various data types, indexed from zero. They allow for creation through methods or literal expressions and support numerous properties and methods for manipulation and data retrieval. Common operations include adding, removing, and accessing elements, as well as merging arrays without altering originals.  MORE q

By on April 11th, 2020 in

Variables in JavaScript

Variables in JavaScript are basically names or references to storage locations in memory. A variable name needs to start with a letter (lowercase is most common, though uppercase can be used), an underscore( _ ) or dollar sign( $ ). Variables will be either local, which means they are only accessible within a function or brackets, or global, which means they are accessible anywhere. Variable Declarations var - scoped globally. const - block scoped by curly brackets {} and unchangeable. let - block scoped and changeable. The last option is  MORE q

By on April 10th, 2020 in

Objects in JavaScript

Objects are the center of JS programming. Methods and Properties can be attached. Objects are lists or collections of properties For each property, Objects always have a name that is a STRING and a value that can be a STRING, NUMBER or FUNCTION Under the hood: When creating an object or adding a property, the JS engine invokes the [put] method to assign a place in memory. When changing a property, the JS engines invokes the [set] method for changing the  MORE q

By on March 31st, 2020 in

JS Types

JavaScript has several built-in data types: String (text), Number (numeric values), Boolean (true/false), null (intentional absence), undefined (no value assigned), and Symbol (unique identifiers). Each type has specific behaviors and uses. For instance, Boolean evaluates conditions, while Symbol prevents property conflicts in objects.  MORE q

By on March 30th, 2020 in