Shubham Vora has Published 957 Articles

Is it a good practice to end switch with defaults in JavaScript?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:54:20

867 Views

In this tutorial, we will learn if it is a good practice to end switch with defaults in JavaScript. In JavaScript, we generally use the if or if-else statements if we need to check any conditions. Still, if we need to check multiple conditions for an expression, it becomes very ... Read More

How to work with document.body in JavaScript?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:53:23

9K+ Views

In this tutorial, we will learn how to work with document.body in JavaScript. Use the document.body property in JavaScript to get the body of the document, i.e., tag. The tag defines the body of the document. The entire content of an HTML document, including all headings, paragraphs, images, ... Read More

How to validate a date pattern in JavaScript?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:49:44

663 Views

In this tutorial, we will learn how to validate a date pattern in JavaScript. The Date object in JavaScript represents a single point in time in a platform-independent way. It carries a number representing time in milliseconds since January 1, 1970, at 00:00:00. (UTC). The Date object can format differently, ... Read More

How to use the

What does “use strict” do in JavaScript, and what is the reasoning behind it?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:42:23

267 Views

In this tutorial, we will learn what "use strict" does in JavaScript. The "use strict" is a directive. JavaScript 1.8.5 is its origin. The use strict directive says that the JavaScript code must run in the strict mode. The strict directive is not a statement but rather a constant expression. ... Read More

What does the operator || do in a var statement in JavaScript?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:40:20

232 Views

In this tutorial, we will discuss what the operator || does in a var statement in JavaScript. The logical OR operator or logical disjunction on the operands returns true if any of the operand values are true, false, ’’, null, undefined, 0, and NaN are the false values. All other ... Read More

What does “javascript:void(0)” mean?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:27:30

5K+ Views

In this tutorial, we will learn what “javascript: void(0)” means. In English, void means nothing. In a programming language, void means return nothing. “javascript: void(0)” is similar to void. javascript: void(0) means return undefined as a primitive value. We use this to prevent any negative effects on a webpage when ... Read More

What does a JavaScript plugin consist of?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:24:48

3K+ Views

In this tutorial, we will discuss plugins in JavaScript. So what is a plugin? A plugin is a JavaScript code written in a file. This file supplies various methods that we can use for various purposes. A plugin has an entry in the array. An entry has following properties − ... Read More

What characters are valid for JavaScript variable names?

Shubham Vora

Shubham Vora

Updated on 31-Oct-2022 11:23:19

6K+ Views

In this article, we will learn what characters are valid for JavaScript variable names. We use variables to save values. First, we have to define the variable, and then we can assign a value to it. We can use the variable name to access the variable in the code. With ... Read More

Advertisements