Shubham Vora has Published 962 Articles

How do I convert a float number to a whole number in JavaScript?

Shubham Vora

Shubham Vora

Updated on 20-Jul-2022 08:17:30

3K+ Views

In this tutorial, we will learn to convert a float number to a whole number in JavaScript. The whole number is the number that doesn’t contain the fractional part. For example, 5.22 is the float number containing the fractional part, and the whole number doesn’t contain a decimal part. So, ... Read More

How do I compare String and Boolean in JavaScript?

Shubham Vora

Shubham Vora

Updated on 20-Jul-2022 08:08:25

4K+ Views

In this tutorial, we will learn to compare a string to the Boolean in JavaScript. The JavaScript has an equality operator to compare one value with another value.There are two types of equality operators in JavaScript; one is an equality operator (==), and another is a strict equality operator (===). ... Read More

How do I check if an array includes an object in JavaScript?

Shubham Vora

Shubham Vora

Updated on 20-Jul-2022 08:01:11

5K+ Views

In this tutorial, we will learn to check whether an array includes an object or not. The actual array contains the values with the same data types. In JavaScript, the array is replaced with the list, including values with any data type even if users can add the objects inside ... Read More

How can I escape HTML special chars in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Jul-2022 14:27:51

7K+ Views

HTML contains special characters such as ‘, ’ ‘/, ’ and many more such as single and double commas. These special characters are used for the HTML tag, such as ‘’ is used to close the HTML tag. This tutorial teaches us to escape HTML special characters in JavaScript.Now, the ... Read More

How can I use a label with break statement in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Jul-2022 13:24:13

662 Views

This tutorial will teach us to use a label with a break statement in JavaScript. The label and break statement are not new in JavaScript, and many of you are familiar with both. The label is a unique string we can use to give the identity to the block of ... Read More

How can we use a JavaScript function as an object?

Shubham Vora

Shubham Vora

Updated on 14-Jul-2022 13:22:47

2K+ Views

This tutorial will teach us to use the JavaScript functions as an object. However, functions, objects, and arrays are the mutable data types in JavaScript, and all mutable data types are the objects.The JavaScript object is one type of entity that contains the key-value pairs. It contains unique keys; every ... Read More

How can we assign a function to a variable in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Jul-2022 13:18:22

20K+ Views

In this tutorial, we will learn to assign a function to a variable in JavaScript. The function is the code block that we can reuse quickly, often just by making a function call. There are two ways to declare a function in JavaScript, one is a named function, and another ... Read More

How can I use a label with continue statement in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Jul-2022 13:16:24

496 Views

This tutorial will teach us to use a label with the continue statement in JavaScript. In the ES5, we were using the label with the go-to statement to jump over the iteration, but it is not supported in the ES6 version of JavaScript. So, we will use the continue statement ... Read More

How can I specify the base for Math.log() in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Jul-2022 12:56:27

559 Views

In this tutorial, we will learn to calculate the logarithm of any number value and specify the base for the Math.log() method.The logarithmic operation of mathematics is beneficial in many places. For example, if you want to show the graph representation for billions of values, it is hard to render ... Read More

How can I simplify the usage of Regular Expressions with JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Jul-2022 12:52:25

199 Views

In this tutorial, we will learn to simplify the use of regular expressions in JavaScript. Some of you have heard the regular expression word for the first time. So, it is not related to JavaScript but can be used in any programming language.The simple definition of the regular expression is ... Read More

Advertisements