How to Install Themes in Chrome Dev Tools — Make the Chrome Console Colorful

This article shows you how to add themes in your Chrome developer console and make it look like your favorite IDE or text editor To make your Chrome dev tool look like your IDE, you need to: Enable the experiment flag Allow custom UI themes in your Chrome. Install a UI Extension (Material Theme) from the …

Generating Random Numbers in JavaScript

It’s more than Math.random() Image by NeONBRAND The Math.random() will generate a pseudo-random floating number (a number with decimals) between 0 (inclusive) and 1 (exclusive). Here, the random number doesn’t mean that you always get a unique number. It generates the same number only after some interval. The interval here is very long, so you …

Debug Like a Lion With Chrome’s DevTools

Tips and tricks for using Chrome’s DevTools more effectively Image by Ivan Diaz You can open Chrome’s DevTools with CMD + option + J. Note: This tricks only works in the Chrome console. 1. $_ If you type $_ in the console, it will print the last evaluated expression in the console. Example: 6 + 6 …

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 …

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; …

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 …

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 …

Detecting Focus of a Browser Tab in JavaScript

Determine if a tab has received focus from the user and how to handle events if the focus changes Image by Sincerely Media The Page Visibility API gives us the power to determine when a page has focus. The API also triggers visibilitychange event when the focus of the page changes. The Page Visibility API is …

Design a site like this with WordPress.com
Get started