Lokesh Yadav has Published 54 Articles

Weekday as a number in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:19:11

In this article, we are going learn about the weekday as a number in JavaScript with appropriate examples. To get the weekday as a number, JavaScript has provided getDay() method. The getDay() is a method from Date object. The getDay() method returns a value between 0 to 6. For example, ... Read More

Merge sort vs quick sort in Javascript

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:17:35

In this article, we are going to discuss about the differences between merge sort and quick sort in JavaScript with appropriate examples. Merge sort and Quick sort are used to sort the elements, but the approach is different. Both Merge sort and quick sort are based on Divide and Conquer ... Read More

d vs D in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:16:12

This article discusses about \d vs\ D in JavaScript regex. The \d and \D meta characters are used to match the characters of a given string. \d and \D are different from each other. \d (character) is equivalent to [0-9] that means it matches any single number. The characters that ... Read More

w vs W in JavaScript regex?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:13:21

This article discusses about the \w vs \W in JavaScript regex. The \w and \W meta characters are used to match the characters of a given string. \w and \W are different from each other. \w (character) is equivalent to [a-zA-Z0-9_] that means it matches any single letter, number, or ... Read More

How to convert a string into integer in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:11:18

In this article, we’ll go over how to convert a string into integer in JavaScript with appropriate examples. To convert a string to an integer parseInt(), Number(), and Unary operator(+) function is used in javascript. parseInt() function returns Nan( not a number) when the string doesn’t contain number. If a ... Read More

Super keyword in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:09:56

In this article, we are going to discuss about the super keyword in JavaScript with suitable examples. The Super keyword is basically used in Object Oriented Programming. The Super keyword is used to call parameters and functions of an object’s parent. There are times a parent class and sub class ... Read More

Execute digits in even places in a JavaScript array?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:08:19

In this article, the given task is to execute digits in even places in a JavaScript array with suitable examples. To execute the digits in even places in a JavaScript array, we need to get the starting index of the array and we need to loop through it by checking ... Read More

How "getElementByID" works in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:06:26

This article discusses about how “getElementByID” method work in JavaScript. The getElementByID() method in JavaScript is a document method. When we give a specific string which should match the ID of the HTML element, it returns the element object. Every HTML element can be assigned a unique ID. If two ... Read More

First and last child node of a specific node in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:04:58

In this article we are going to learn about the first and last child node of a specific node in JavaScript along with suitable examples. To get the first and last child node of a specific node, there are existing properties called firstChild, lastChild, firstElementChild and lastElementChild. The difference between ... Read More

Remove the child node of a specific element in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 09:57:51

In this article we are going to discuss how to remove the child node of a specific element in JavaScript with appropriate examples. To remove the child node of a specific element, there is an existing method in JavaScript called removeChild(). The removeChild() method is different from the remove() method. ... Read More

Advertisements