In web development, you often need a data structure to hold a mapping of key/value pairs. This data structure has many names: a map, a dictionary, an associative array... Its functionality, however, always remains the same. The data structure [...]
The for loop is one of the most common operations in programming.
The for loop is used to execute a specific code block a specified number of times. Generally, one of the most common use-cases of this loop is [...]
Summary
TypeScript just like JavaScript has a special typeof operator.
In TypeScript, the typeof operator is used to refer to the type of a variable in a type context.
const v = 'This is a string';
const data: typeof [...]
In JavaScript, there is a lot of different ways to capitalize the first letter of a string.
You can capitalize the first letter with a combination of built-in javascript functions, with regex expressions and, even with CSS.
Read this [...]
In JavaScript, the slice() function is part of both the Array and the String prototype.
This function is used to select items or characters based on the provided indices.
In this article, you will find all the information needed [...]
To get the time in JavaScript, you will need to work with the built-in Date object.
The Date object represents a moment in time in a platform-independent manner and has a lot of helper functions that will help the [...]
When it comes to rounding a number to two decimal places in JavaScript, a developer has a lot of options. It can be done with:
The toFixed() function.
The Math.round() function.
A helper function.
The lodash round() function [...]
In JavaScript, you have a lot of options when it comes to the concatenation of strings.
You can use:
The + operator.
Template literals.
The built-in concat() function of String.
The built-in join() function of Array.
In this article [...]
In JavaScript, to make a string uppercase, the easiest way to do it is by using the toUpperCase() built-in function.
This function is easy to master (even for a beginner), and you will become a pro of using it [...]
In JavaScript, to extract part of a string, you need to use the substring() function, or one of its alternatives.
You may know the substring() function, but do you know everything about it?
In this article, you will find [...]