Get the Smallest of Zero or More Numbers in JavaScript

Shubham Vora
Updated on 26-Aug-2022 13:18:43

747 Views

In this tutorial, we shall learn to find the smallest among numbers in JavaScript. Let’s discuss the available methods one after the other Using the Math.min() Method Here, the Math.min() is a static function of the placeholder object Math. If no parameters, the result is -Infinity. If the parameters are numbers, the result is the smallest among them. If any one of the parameters is not a number, the method returns NaN. This is an ECMAScript1 feature. Syntax Following is the syntax of Math.min() method − Math.min(a1, a2, …an) Here, we need to give numbers as parameters. Parameters ... Read More

Get the Day of the Week in JavaScript

Shubham Vora
Updated on 26-Aug-2022 13:14:12

2K+ Views

The most common techniques for getting a day of the week and the name of the day in JavaScript will be covered in this tutorial. It is important to remember that if you are working on a small project, starting to install packages for something basic may be difficult. Small apps should be developed using JavaScript's built-in techniques; dependencies should only be included when absolutely necessary. Following are the approaches to get the day of the week in JavaScript − Using the getDay() Method Using the toLocaleString() Method Using the getDay() Method Use the JavaScript getDay() method ... Read More

Find Digits Between Brackets in JavaScript RegExp

Sravani Alamanda
Updated on 26-Aug-2022 13:09:37

815 Views

In this tutorial, we learn how to find the digits between brackets using JavaScript RegExp. The ASCII values for the digits (0-9) start from 48 to 57. We denote the digits in the bracket as [0-9] in the regular expression. To find the digits in a range except for all digits, we can write the particular range. As to find the digits between 4 and 8, we could write it as [4-8] in the regular expression pattern. Now, our aim is to find digits inside the brackets in the text using RegExp in JavaScript. We could follow the below syntaxes ... Read More

Get the Largest of Zero or More Numbers in JavaScript

Shubham Vora
Updated on 26-Aug-2022 13:07:28

321 Views

In this tutorial, we will look at how to get the largest of zero or more numbers in JavaScript. The maximum of multiple numbers can be found using different techniques. The first technique we will introduce is the Math.max() method. The second technique will be the for-loop method. Following are the methods to get the largest of zero or more numbers in JavaScript − Using the Math.max() Method We can use the Math.max() method to find the largest of many numbers. It returns the largest value from the given multiple values. The input parameters should be numbers or can ... Read More

Get Exponent Power of a Number in JavaScript

Shubham Vora
Updated on 26-Aug-2022 13:04:14

4K+ Views

In this tutorial, we will learn how to get the exponent power of a number in JavaScript. The power of a number can be termed as how many times a particular number is multiplied by the number itself. For calculating the power of a number, we require two things, Base and Exponent. At the same time, a Base is a number that must be multiplied. Exponent (Usually written in the superscript) determines the number of times the number (Base) should be multiplied by itself. While we represent the power of a number using "^" or superscript when typing it, we ... Read More

Find Digit with JavaScript RegExp

Sravani Alamanda
Updated on 26-Aug-2022 13:03:17

927 Views

In this tutorial, we will see how to find digits (0-9) using JavaScript RegExp. ASCII value for digits [0-9] starts from 48 to 57. If you want to print any ASCII value for a digit, 48 needs to be added to that digit. We denote digits as \d in the regular expression. A RegExp is an object that specifies the pattern used to do a search and replace operations on the string or for input validation. Syntax Following is the syntax for regular expression pattern of digit or \d character − new RegExp("\d") or simply /\d/ /\d/ is ... Read More

Get the Day of the Month in JavaScript

Shubham Vora
Updated on 26-Aug-2022 13:01:36

6K+ Views

In this tutorial, we will learn how to find out the day of the month using JavaScript. We'll go over the most popular methods which are used for obtaining the name of the month and day in JavaScript. It is important that starting to install packages for something basic may be frustrating if you are working on a tiny project. JavaScript's built-in methods should be used to implement small applications; dependencies should only be added when absolutely necessary Using the getDate() Method A built-in data type for working with dates and times is the Date object. The new Date ... Read More

Find New Line Character with JavaScript RegExp

Sravani Alamanda
Updated on 26-Aug-2022 12:55:22

4K+ Views

The new line character, we denote as . This is used to make a line break. ASCII code for is 10 and it is also called Line Feed (LF). Now, let's see how to find a new line character using RegExp. A RegExp is an object that specifies the pattern used to do search and replace operations on the string or for input validation. RegExp was introduced in ES1 and it is fully supported by all browsers The RegExp meta character finds an index value of the first occurrence of a newline character in a given text. Syntax ... Read More

Find Form Feed Character with JavaScript RegExp

Sravani Alamanda
Updated on 26-Aug-2022 12:52:29

1K+ Views

Form feed character is page breaking ASCII control character. It is commonly used for page separators. When you want to insert a page break, the text editor can use this form feed. It is defined as \f and has an ASCII code value as 12 or 0x0c. RegExp is an object that specifies the pattern used to do a search and replace operations on a string or for input validation. RegExp was introduced in ES1, and it is fully supported by all browsers. Now, we will check how to find the form feed (\f) character in the given text using ... Read More

Disadvantages of Using innerHTML in JavaScript

Abdul Rawoof
Updated on 26-Aug-2022 12:00:15

3K+ Views

HTML stands for Hyper Text Markup Language, through the HTML we can design a block of webpages. Html is a frontend markup language that is used to build the content of frontend pages. It means that we can build a structure of web pages. Through HTML we can design the content of any website. It means that we can create headings, buttons, paragraphs, headers, footers, links, etc for any website. Example let’s try to understand to implement a program − Basic of ... Read More

Advertisements