🚀 CYBER WEEK SALE: 50% OFF on JavaScript Fundamentals 💪

Introduction to HTML for beginners

What is HTML after all? HTML stands for HyperText Markup Language. HTML is responsible for the structure and content of a page, and tags are the building blocks for building a page....

February 22, 2021 · 4 min · Coderslang Master

JS Interview #40: What is the type of `undefined` in JS?

What’s the output? . . . . . . . . . . . . . . . . . In JavaScript, the typeof operator always returns a string. So, even though typeof undefined evaluates to undefined, it’s a string and not the primitive undefined value....

February 22, 2021 · 1 min · Coderslang Master

Optimized bubble sort in JavaScript. Cocktail sort

Bubble sort algorithm doesn’t track the current state of the array. Even if it gets the fully sorted array as an input, the runtime will remain of the same O(n^2^) complexity....

February 21, 2021 · 5 min · Coderslang Master

Bubble sort in JavaScript

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order....

February 20, 2021 · 3 min · Coderslang Master

Algorithm complexity and efficiency

All algorithms have 2 main characteristics: Amount of required memory. Execution time. These two are used to compare algorithms with each other. Some algorithms are faster, but require more memory, while others are vice versa....

February 19, 2021 · 3 min · Coderslang Master

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’s try to simplify it by removing the setTimeout....

February 19, 2021 · 1 min · Coderslang Master

HTML, how to add a comment

To add a comment into an HTML document, there’s a special tag <!-- comment -->. There are times when you need to add comments to an HTML page. Comments are text that will be visible to your colleagues, but not visible to users who browse your website....

February 18, 2021 · 2 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’s less than or equal n....

February 17, 2021 · 2 min · Coderslang Master

HTML, insert an image into the page

To insert an image into the HTML document, you can use the tag <image>. This HTML tag has 2 key attributes: src — defines the path to the image file alt — sets the alternative text....

February 16, 2021 · 2 min · Coderslang Master

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

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

February 16, 2021 · 1 min · Coderslang Master