AmitDiwan has Published 10744 Articles

JavaScript array.includes() method

AmitDiwan

AmitDiwan

Updated on 08-May-2020 10:37:45

145 Views

The JavaScript array.includes() method is used to check if an array contains a given element or not.Following is the code for the array.includes() method −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample { ... Read More

JavaScript focus

AmitDiwan

AmitDiwan

Updated on 07-May-2020 15:04:05

521 Views

The JavaScript focus() method is used for focusing on an element only if the element can be focused.Following is the code for the JavaScript Focus() Method −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }   ... Read More

JavaScript exec() Method

AmitDiwan

AmitDiwan

Updated on 07-May-2020 15:00:01

219 Views

The exec() method executes the search for match and if the matched text is found in the specified string then it is returned otherwise null is returned.Following is the code for the JavaScript exec() Method −Example Document    body {       font-family: "Segoe ... Read More

JavaScript escape()

AmitDiwan

AmitDiwan

Updated on 07-May-2020 14:51:01

718 Views

The escape() function in JavaScript is used for encoding a string. It is deprecated in JavaScript 1.5.Following is the code for the JavaScript escape()Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {   ... Read More

JavaScript Error name Property

AmitDiwan

AmitDiwan

Updated on 07-May-2020 14:48:00

174 Views

The error name property is used for setting or getting the name of the error.Following is the code for the Error name property −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {   ... Read More

JavaScript Error message Property

AmitDiwan

AmitDiwan

Updated on 07-May-2020 14:43:52

231 Views

The error message property sets or returns an error message in JavaScript. Following is the code for the error message property −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {       ... Read More

JavaScript encodeURI(), decodeURI() and its components functions

AmitDiwan

AmitDiwan

Updated on 07-May-2020 14:37:11

292 Views

The encodeURI() function encodes the complete URI including special characters except except (, / ? : @ & = + $ #) characters.The encodeURIComponent() function encodes some parts of the URI by basically encoding the special characters. It also encodes the following characters − (, / ? : @ & ... Read More

JavaScript – Getting Coordinates of mouse

AmitDiwan

AmitDiwan

Updated on 07-May-2020 14:21:10

477 Views

To get the coordinates of mouse using JavaScript, the code is as follows −Example Live Demo    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {       font-size: 25px;       font-weight: 500;    } ... Read More

JavaScript Convert a string to boolean

AmitDiwan

AmitDiwan

Updated on 07-May-2020 14:08:17

261 Views

To convert a string to boolean in JavaScript, the code is as follows −Example Live Demo    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    } Converting string to boolean CLICK HERE Click the above button to convert ... Read More

JavaScript Const

AmitDiwan

AmitDiwan

Updated on 07-May-2020 14:04:50

284 Views

The JavaScript const declarations create variables that cannot be reassigned to some other value or redeclared later. It was introduced in ES2015.Following is the code for JavaScript const declaration −Example Live Demo    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    } ... Read More

Advertisements