Found 6710 Articles for Javascript

JavaScript Number Function

AmitDiwan
Updated on 11-May-2020 13:48:26

218 Views

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

JavaScript Number.MAX_VALUE & Number.MIN_VALUE with Examples

AmitDiwan
Updated on 11-May-2020 13:43:11

128 Views

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

JavaScript multiline Property

AmitDiwan
Updated on 11-May-2020 13:37:11

152 Views

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

JavaScript match()

AmitDiwan
Updated on 11-May-2020 13:31:20

348 Views

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

JavaScript Location protocol Property

AmitDiwan
Updated on 11-May-2020 13:29:26

200 Views

The JavaScript location protocol property returns the protocol used by the current URL.Following is the code for Location protocol Property 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;    } Location protocol Property CLICK HERE Click on the above button to get the location protocol    let sampleEle = document.querySelector(".sample");    document.querySelector(".Btn").addEventListener("click", () => {       sampleEle.innerHTML = 'The protocol used by the website = ' + location.protocol;    }); OutputOn clicking the “CLICK HERE” button −

JavaScript Let

AmitDiwan
Updated on 11-May-2020 13:25:57

203 Views

The JavaScript Let keyword introduced in 2015 allows us to define block scoped variables.Following is the code for declaring variable using Let keyword 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 Let CLICK HERE Click on the above button to access the varible    let sampleEle = document.querySelector(".sample");    document.querySelector(".Btn").addEventListener("click", () => {     ... Read More

JavaScript - length of array objects

AmitDiwan
Updated on 11-May-2020 13:06:39

345 Views

The length property in JavaScript returns the size of the object. Following is the code for the length of string and array objects −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 length property CLICK HERE Click on the above button to find the length of the array    let sampleEle = document.querySelector(".sample");    let resultEle = document.querySelector(".result");    let arr = [1, 2, "A", "B", "D"];    sampleEle.innerHTML = arr;    document.querySelector(".Btn").addEventListener("click", () => {       resultEle.innerHTML += "The array length is = " + arr.length;    }); OutputOn clicking the ‘CLICK HERE’ button −

JavaScript lastIndex Property

AmitDiwan
Updated on 11-May-2020 13:03:01

119 Views

The lastIndex property in JavaScript returns the index position when a match occurs and the next match then resumes from that position only. The lastIndex property works only if the ‘g’ modifier is set.Following is the code for the lastIndex property 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 lastIndex Property The king bought an expensive ring. ... Read More

JavaScript - know the value of GET parameters from URL

AmitDiwan
Updated on 11-May-2020 12:57:08

227 Views

To know the value of GET parameters from URL in JavaScript, the code is as follows −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {       font-size: 18px;       font-weight: 500;       color: red;    } GET parameters from URL https://www.google.com?imageSize=440&color=blue CLICK HERE Click on the above button to get the imageSize and color value from the above URL    let sampleEle = document.querySelector(".sample");    let resultEle = document.querySelector(".result");   ... Read More

JavaScript JSON.stringify() with Example

Disha Verma
Updated on 13-Mar-2025 13:05:29

408 Views

In JavaScript, the JSON.stringify() method is a useful tool that converts JavaScript objects into JSON strings. This is important when dealing with APIs, storing data, or transferring information between different systems. Knowing how to use JSON.stringify() helps developers manage data transformations in their applications. In this article, we will look at how JSON.stringify() works, its syntax, the parameters it uses, and some examples of how to use it well. The basic syntax for JSON.stringify() is as follows: JSON.stringify(obj, replacer, space) Let's understand the parameters used in JSON.stringify() syntax: obj: The JavaScript object to be ... Read More

Advertisements