A Quick Overview of map(), filter(), and reduce() in JavaScript

Image by Nathan Dumlao Learn how to use map, filter, and reduce in JavaScript. Higher Order Functions A higher-order function is a function that takes one or more functions as arguments or returns a function as its result. map, filter, andreduce are all higher order functions, which take a function as an argument. Map, Filter, Reduce …

Creating a Color Generator Website in JavaScript

Learn about how to create a website which will generate unique colours Image by Paola Galimberti This is how the final result looks like In this tutorial we are only focusing on Javascript , you can just copy and paste the html and css from the above pen. The UI has Color Block → Created using JavaScript …

Become a writer in JavaScript Dots .

Submitting story to JavaScript Dots. Image by The Climate Reality Project Want to spread your teaching skills to the world . Let’s us help you by publishing your story through our publication and make the story travel đź§ł through the world 🌍 . We will publish any submission related to the JavaScript. Checklist before submitting stories Mandatory Add …

Basics of loops in JavaScript

Learn about Different ways to loop in JavaScript Image by Tine IvaniÄŤ What is Loop ? Consider we need to print “hi” 5 times. If we don’t have loop , what we would be doing is console.log(“hi”);console.log(“hi”);console.log(“hi”);console.log(“hi”);console.log(“hi”); But , if we know how to use loop , then we can simplify the above code to for(let i = 1; i …

Six ways to create an Array in JavaScript.

Learn Different ways to create JavaScript Arrays. Image by Clem Onojeghuo 1 . Using assignment operator var array = []; var array2 = [1,2,3,4,5]; 2. Using new operator new Array(length) ; Creates an array with length set to the number. length > 0 otherwise it will throw error var arr = new Array(2); arr; [empty Ă— 2] arr.length; …

Detecting the End of CSS Transition Events in JavaScript

An overview of proper chaining Image by Hello I’m Nik 🇬🇧 Before CSS transition and animation (keyframes), to animate, we needed to code in JavaScript. But once these two properties were introduced, we can achieve complex animations with only CSS. In JavaScript, we can call the callback function once the animation is done. But in CSS, there …

Add Styles and Formatting to Your console.log Messages in JavaScript

Learn how to add CSS and formatting log messages in JavaScript. Image by Joanna Kosinska We all know the console.log function will log a simple message to the console. But console.log can also format the text and make the message stand out from other messages. This gives us the ability to find our important messages in …

Dot vs Bracket Notation in Accessing JavaScript Object.

Learn when to use dot and bracket notation in JavaScript. Dot vs Bracket notation in JavaScript We can access the property of an object by Dot notation Bracket notation Dot Notation This is the most popular and most used way of accessing the property of an object. This makes code more readable. Dot notation is …

Different Ways to Duplicate Objects in JavaScript

It turns out there are a lot of different ways to duplicate objects Photo by James Orr on Unsplash In JavaScript, a variable can store two types of data: Primitive Reference When we copy primitive values, only the value will be copied. var a = 10; var b = a; console.log(a, b); // 10, 10 b …

Understand the Three Different Value Equality Comparison Algorithm in JavaScript.

Learn about different types of equality checking in JavaScript. Image from Coffee Geek. In JavaScript, there are three different value-comparison operations Abstract Equality Comparison(loose equality || == || double equals). Strict Equality(triple equals || === ). Same Value Equality ( Object.is() ). Introduced in ES2015 . Abstract Equality Comparison (==). a == b; Double Equals compares whether …

Design a site like this with WordPress.com
Get started