Saurabh Jaiswal has Published 43 Articles

How to attach one or more drop-shadows to the box with JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 06-Jan-2023 13:26:42

1K+ Views

To attach one or more drop shadows to a box with JavaScript, you can use the box-shadow style property. You can specify the shadow's offset, blur radius, spread radius, and color by passing values for these properties in the box-shadow property. Syntax Following is the syntax to add one or ... Read More

How to add new value to an existing array in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 06-Jan-2023 13:05:21

3K+ Views

In programming, it is very common to add new value to an existing array whether you are building a small or high-level application, whenever we need to extend the number of items in an array we use it to add new value in the array. In this article, we will ... Read More

How to access cookies using document object in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 06-Jan-2023 12:58:06

7K+ Views

With JavaScript, you can easily access/ read cookies with the “document.cookie” property. Reading a cookie is just as simple as writing one because of the value of the document.cookie object is the cookie. The document.cookie string will keep a list of name=value pairs separated by semicolons, where the name is ... Read More

What is a standard for commenting a function in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 05-Jan-2023 16:15:47

6K+ Views

JavaScript is used everywhere, from creating the back end using environments like Node.js to creating the front end using React.js, Vue.js, etc. In JavaScript, the uses of a function are very high, it is used for performing a group operation, it is used as a callback, as a constructor, ... Read More

How is JavaScript an interpreted language?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 05-Jan-2023 15:31:45

3K+ Views

JavaScript is a lightweight and interpreted language, therefore, inside the context of a web browser, you don't even need to buy a compiler. You can start with a simple text editor such as Notepad. To make our life simpler, various vendors have come up with very nice JavaScript editing tools. ... Read More

What is a NaN property of a Number object in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 05-Jan-2023 15:27:18

443 Views

In JavaScript, the NaN property is a special value that represents "Not a Number". It is a property of the Number object and can be accessed using Number.NaN. The NaN property is usually produced as a result of an operation that cannot produce a meaningful result. For example, dividing 0 ... Read More

How to catch all JavaScript errors?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 05-Jan-2023 15:22:54

10K+ Views

To catch all JavaScript errors, we can use the window.onerror() method which acts like a global try-catch statement. The onerror event handler was the first feature to facilitate error handling in JavaScript. The error event is fired on the window object whenever an exception occurs on the page. The onerror ... Read More

How to add 30 minutes to a JavaScript Date object?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:30:54

10K+ Views

In this tutorial, we will learn how to add 30 minutes to a JavaScript Date object. Here we will discuss two methods which are following. Using the setMinutes( ) Method Using the getTime() Method Using the setMinutes Method The setMinutes() function of the date object accepts an integer ... Read More

How to add number of days to JavaScript Date?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:21:05

17K+ Views

In this tutorial, we will learn how to add a number of days to a JavaScript Date object. Here we will discuss two methods which are following. Using the setDate( ) Method Using the getTime() Method Using the setDate( ) Method JavaScript date setDate() method sets the day ... Read More

How to add new array elements at the beginning of an array in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:17:40

298 Views

We will learn how to add new array elements at the beginning of an array in JavaScript. To achieve this in JavaScript we have multiple ways, a few of them are following. Using the Array unshift() Method Using the Array splice() Method Using ES6 Spread Operator Using the ... Read More

Advertisements