Shubham Vora has Published 962 Articles

Can String be considered as a Keyword?

Shubham Vora

Shubham Vora

Updated on 05-Oct-2023 12:50:26

79 Views

Keywords are important in any programming language, as they are reserved words with a particular predefined meaning. The keywords are used to define the variables, function, and class, change the program's control flow, traverse the list, etc. When we talk about the 'String', it is a fundamental data type to ... Read More

How to sort strings in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Sep-2023 21:35:27

26K+ Views

The sorting string is to arrange strings in the dictionary or alphabetical order. It is usual to sort the array of strings while developing applications using JavaScript. In this tutorial, we will learn to sort strings in JavaScript. For example, string sorting is very useful here if you got some ... Read More

Extract a number from a string using JavaScript

Shubham Vora

Shubham Vora

Updated on 14-Sep-2023 15:57:17

28K+ Views

In JavaScript, there are multiple ways to extract a number from a string. One way is to use the match() method and a regular expression to search for all numeric digits in the string. Another way is to use the replace() method and a regular expression to remove all nonnumeric ... Read More

How to check whether a value is a number in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Sep-2023 14:11:27

25K+ Views

In this tutorial, we will learn to check whether a value is a number in JavaScript. In JavaScript, it is necessary to check the variable's data type while performing some operation. Otherwise, it can create some unknown bugs in your application. For example, when users use the addition operator with ... Read More

How to format strings in TypeScript?

Shubham Vora

Shubham Vora

Updated on 14-Sep-2023 02:35:36

33K+ Views

In this tutorial, we will learn to format the strings in TypeScript. The string is the sequence of characters in any programming language, and the same goes for TypeScript. In TypeScript, strings are immutable. The meaning of the immutable is that we can’t change the string character at the particular ... Read More

How to pass an object as a parameter in JavaScript function?

Shubham Vora

Shubham Vora

Updated on 13-Sep-2023 15:33:27

29K+ Views

In this tutorial, we will learn how to pass an object as a parameter in a JavaScript function. One of JavaScript's data types is represented by the Object type. It is used to store keyed collections as well as more complex entities. The Object() function Object()or the object initializer / literal ... Read More

How to check whether a JavaScript date is valid?

Shubham Vora

Shubham Vora

Updated on 13-Sep-2023 14:43:57

27K+ Views

In this tutorial, we will learn to check whether a JavaScript date is valid or not. Let’s understand why we need to validate the date in JavaScript by example. Suppose you have developed an application that takes some information in the submission form from the user. Users can make a ... Read More

How to get first and last date of the current month with JavaScript?

Shubham Vora

Shubham Vora

Updated on 13-Sep-2023 14:30:48

27K+ Views

In this tutorial, we will look at how to get the first and last date of the current month using JavaScript. In our daily lives, we frequently deal with dates, and we typically are aware of the day—or, at the very least, the month—we are in. To assist users in ... Read More

How to display the selected option in a dropdown list with JavaScript?

Shubham Vora

Shubham Vora

Updated on 12-Sep-2023 03:02:04

28K+ Views

In this tutorial, we will learn how to display the selected option in a dropdown list with JavaScript. What is a dropdown list? A dropdown list is a switchable menu that enables users to select one item from various options. A drop-down list is generated with the tag is ... Read More

How to stop forEach() method in JavaScript?

Shubham Vora

Shubham Vora

Updated on 12-Sep-2023 01:16:52

39K+ Views

In JavaScript, Programmers can use the forEach() method to iterate through the array of elements. We can call a callback function, which we can pass as a parameter of the forEach() method for every array element. Sometimes, we may require to stop the forEach() loop after executing the callback function ... Read More

Advertisements