| by Arround The Web

Arrow functions in JavaScript | Explained

Arrow function is a way of creating a function with the symbol “=>” used instead of the keyword function, hence the name Arrow Function

Share Button
Read More
| by Arround The Web

Array reduce() Method in JavaScript | Explained

The Array reduce() method is used to implement a callback function on every array element and compute a single final value.

Share Button
Read More
| by Arround The Web

Array and Array of Objects | A Comparison – JavaScript

Arrays are used to store data multiple instances of data under a single name. An Array of objects means all its elements are individual Objects.

Share Button
Read More
| by Arround The Web

How to convert milliseconds to date

To convert milliseconds to date, provide the milliseconds stored in a variable to the Date() constructor and it will perform the conversion.

Share Button
Read More
| by Arround The Web

JavaScript Date getTime() Method

In JavaScript, the getTime() is used to extract the milliseconds from the specified time. This method is applied to the date object.

Share Button
Read More
| by Arround The Web

How to Get the Value of Text Input Field Using JavaScript?

In JavaScript, the getElementById and getElementsByClassName methods are utilized to get the value of a text input field by pressing a button.

Share Button
Read More
| by Arround The Web

How to Detect Browser or Tab Closing in JavaScript?

The beforeunload event is triggered to detect the closing of the tab or browser. An example is provided to demonstrate this event in JavaScript.

Share Button
Read More
| by Arround The Web

How to Check if a Variable Is Not Null in JavaScript?

If-else statements can be used to determine whether a variable is a null variable or not. However, if-else cannot detect other falsy values.

Share Button
Read More
| by Arround The Web

How to Check a Key Exists in a JavaScript Object?

The “in” operator and the hasOwnPorperty() method of the JavaScript object can be used to find if a specific key exists in an object or not.

Share Button
Read More
| by Arround The Web

Convert String Into a Date Using JavaScript

To convert a string into a date, pass the string in the new Date() constructor of the Date Object in JavaScript. The string should follow ISO format.

Share Button
Read More
| by Arround The Web

Call Multiple JavaScript Functions in onclick Event

The onclick event is employed to call multiple functions with a single click. These functions are placed in the onclick event of the button type.

Share Button
Read More
| by Arround The Web

JavaScript | Window scrollTo() Method

The window.scrollTo() is used to pan the browser’s window to a specific position on the webpage by using the x-coordinate and the y-coordinate.

Share Button
Read More
| by Arround The Web

JavaScript | Focus()

The focus() method is used to bring an element of the HTML document into focus, or in much simpler words, it sets their active property as true.

Share Button
Read More
| by Arround The Web

JavaScript | clearTimeout() & clearInterval() Method

The clearTimeout() and clearInterval() methods are used to stop the execution of code by passing the values set by the setTimeout() and setInterval() methods.

Share Button
Read More
| by Arround The Web

How to Submit a Form by Clicking a Link in JavaScript?

To submit a form by clicking a link with the help of JavaScript, simply make an explicit call to the form.submit() method upon link press.

Share Button
Read More
| by Arround The Web

How to Stop Browser Back Button Using JavaScript?

To stop the working of the back button of the browser simply call window.history.forward() method upon page load using JavaScript.

Share Button
Read More
| by Arround The Web

JavaScript Array isArray() Method

The Array.isArray() method is used to check whether the object passed to its argument an object or not. It was released in ECMA5 JavaScript.

Share Button
Read More
| by Arround The Web

How to Store a Key => Value Arrays in JavaScript?

In JavaScript, Objects and Maps are the two elements that are most suited to store key and value pairs from their individual arrays into a single entity.

Share Button
Read More
| by Arround The Web

How to Select a Random Element From Array in JavaScript?

Use the Math.random() method with either the Math.floor() method or the double NOT Bitwise operator to fetch a random item from an array.

Share Button
Read More
| by Arround The Web

How to Pretty Print JSON String in JavaScript?

For printing a JSON string in JavaScript, a JSON.stringify() method is utilized. This method converts the JavaScript value to a JSON string.

Share Button
Read More