馃殌 CYBER WEEK SALE: 50% OFF on JavaScript Fundamentals 馃挭

JS Interview #39: How does `setTimeout` work inside the `for` loop?

What will be logged to the console? . . . . . . . . . . . . . . . . . Before we analyze the code snippet, let鈥檚 try to simplify it by removing the setTimeout....

February 19, 2021 路 1 min 路 Coderslang Master

JavaScript, using Math.floor to round a number

In JavaScript there are a couple of ways of rounding a number. The function Math.floor rounds the number down. It accepts a number n and returns the biggest integer that鈥檚 less than or equal n....

February 17, 2021 路 2 min 路 Coderslang Master

JS Interview #38: Can you add multiple arrays in JavaScript?

Can you add multiple arrays in JavaScript? What鈥檚 the output? . . . . . . . . . . . . . . . . . . The function add(x, y, z) applies the + operator to the provided arguments....

February 16, 2021 路 1 min 路 Coderslang Master

JavaScript, calculate a square root using Math.sqrt()

To calculate the square root of the number in JavaScript, you can use the function Math.sqrt(). You pass in a number, and it returns the square root of this number....

February 15, 2021 路 1 min 路 Coderslang Master

JavaScript, remove last character from a string

JavaScript strings are immutable. This means that once the string was created it can鈥檛 be changed. When you need to remove the last character from a string in JavaScript, you should create a new string without this character....

February 14, 2021 路 2 min 路 Coderslang Master

How to use Promise chains in JavaScript

Asynchronous programming in JavaScript in unimaginable without Promises and Promise chains. In this tutorial you鈥檒l learn how to create JavaScript Promises, how to handle promise chains and utilise the functions Promise.all and Promise.race. ...

May 7, 2022 路 5 min 路 Coderslang Master

JS Interview #37: What is the type of a single argument provided to the split function?

What鈥檚 the output? . . . . . . . . . . . . . . . . . . In this code snipped, all the arguments provided to the function split will be collected and placed in a single array args....

February 13, 2021 路 1 min 路 Coderslang Master

140 HTML colors with HEX, RGB codes and names

With so many colors to choose from, it can be tough to decide which one to use for your website or blog. But with a little help from this list of 140 HTML colors, you can find the perfect color for your next project....

February 12, 2021 路 7 min 路 Coderslang Master

JavaScript, asynchronous programming and Promise

In this tutorial, you鈥檒l learn what are the promises in JS, which states can the JavaScript Promise be in and how to handle asynchronous errors in JS promises. ...

February 11, 2021 路 4 min 路 Coderslang Master

JavaScript setInterval, how to schedule repeated execution with the delay

Similarly to setTimeout, that executes the callback function once, you can start the repeated execution of the function in JavaScript using setInterval. Starting setInterval timer In JS, setInterval has the same params as setTimeout....

February 10, 2021 路 2 min 路 Coderslang Master