Regular expressions are a string of characters describing a search pattern. This search pattern is then used to specify what we are searching in a text.Following is the code for regular expressions in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample, .result{ font-size: 18px; font-weight: 500; color:red; } JavaScript Regular Expressions The king bought the ring and went to the palace. CLICK HERE Click on the above ... Read More
The Math.random() function is used to generate a random floating-point number between 0 and 1.Following is the code for Math.random() function −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample { font-size: 18px; font-weight: 500; color: red; } JavaScript Random CLICK HERE Click on the above button to generate a random number between 1 to 10 let sampleEle = document.querySelector('.sample'); document.querySelector('.Btn').addEventListener('click',()=>{ let num = Math.floor((Math.random()*10))+1; sampleEle.innerHTML = 'Number generated = ' + num; }) OutputOn clicking the “CLICK HERE” button −
Promises in JavaScript allow us to do asynchronous operations where the value is not known in advanced when the promise was being created. A promise can have three states pending, fulfilled and rejected.Following is the code for promises in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample { font-size: 18px; font-weight: 500; color: red; } JavaScript Promises CLICK HERE Click on the above button to display username ... Read More
Properties in JavaScript are the values associated with an object. Following is the code implementing object properties in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample { font-size: 18px; font-weight: 500; color: red; } JavaScript Object Properties CLICK HERE Click on the above button to display name and age property from testObj object let sampleEle = document.querySelector(".sample"); document.querySelector(".Btn").addEventListener("click", () => { let testObj = { name: "Rohan",age: 23,}; sampleEle.innerHTML += "testObj.name = " + testObj.name + ""; sampleEle.innerHTML += "testObj.age = " + testObj.age + ""; }); OutputOn clicking the ‘CLICK HERE’ button −
The getter and setter keyword are used for accessing the objects. The getter return value is used when a property is being accessed and the setter takes an argument and sets the property value inside the object to that passed argument.Following is the code for accessing objects in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample { font-size: 18px; font-weight: 500; color: red; } JavaScript Object Accessors Enter a ... Read More
Following is an example for numbers in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample{ font-size: 18px; font-weight: 500; color: red; } JavaScript Numbers CLICK HERE Click on the above button to see numbers in JavaScript let sampleEle = document.querySelector(".sample"); let a =22; let b = 1.523; let c = 99; document.querySelector(".Btn").addEventListener("click", () => { sampleEle.innerHTML = 'a = ' + a + ''; sampleEle.innerHTML += 'b =' + b + ''; sampleEle.innerHTML += 'c = ' + c + ''; sampleEle.innerHTML += 'a + c = ' + (a+c) + ''; }); OutputOn clicking the ‘CLICK HERE’ button −
The JavaScript Number() Function converts an object value passed as an argument to its respective numeric value.Following is the code for the JavaScript Number() Function −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample{ font-size: 18px; font-weight: 500; color: red; } JavaScript Number Function CLICK HERE Click on the above to convert some value to their respective numeric value let sampleEle = document.querySelector(".sample"); document.querySelector(".Btn").addEventListener("click", ... Read More
The JavaScript Number.MAX_VALUE & Number.MIN_VALUE property represents the maximum and minimum numeric value representation possible in JavaScript respectively.Following is the code for the JavaScript Number.MAX_VALUE & Number.MIN_VALUE property −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample{ font-size: 18px; font-weight: 500; color: red; } JavaScript Number.MAX_VALUE & Number.MIN_VALUE CLICK HERE Click on the above to get the maximum and minimum number value possible in JavaScript ... Read More
The JavaScript multiline property returns true or false depending upon if the ‘m’ modifier has been set or not.Following is the code for the JavaScript multiline property −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample, .result { font-size: 18px; font-weight: 500; color: red; } JavaScript Math Object The king bought the ring CLICK HERE Click on the above button to see if m modifier has been set ... Read More
The JavaScript match() returns the match as an array object if a match is found in a string against a regular expression.Following is the code for the JavaScript match() method −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample, .result { font-size: 18px; font-weight: 500; color: red; } JavaScript match() The king bought an expensive ring. CLICK HERE Click on the above button to search 'ing' in ... Read More
 
 Data Structure
 Data Structure Networking
 Networking RDBMS
 RDBMS Operating System
 Operating System Java
 Java MS Excel
 MS Excel iOS
 iOS HTML
 HTML CSS
 CSS Android
 Android Python
 Python C Programming
 C Programming C++
 C++ C#
 C# MongoDB
 MongoDB MySQL
 MySQL Javascript
 Javascript PHP
 PHP