AmitDiwan has Published 10744 Articles

How to search for a string in JavaScript?

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:25:44

261 Views

Following is the code for searching a string in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 20px;       font-weight: 500;    } ... Read More

NaN and Infinity example in JavaScript

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:23:32

209 Views

Following is the code to implement NaN and Infinity in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 20px;       font-weight: 500;    } ... Read More

How to delete object properties in JavaScript?

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:21:27

184 Views

Following is the code for deleting object properties in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result, .sample {       font-size: 20px;       font-weight: 500;    } ... Read More

How to create an object and access its properties in JavaScript?

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:18:51

234 Views

Following is the code creating an object and accessing its properties in JavaScript −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       font-size: 20px;       font-weight: 500;   ... Read More

Explain hoisting in JavaScript

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:16:02

381 Views

Hoisting allows us to call functions and variables (declared with var) before they are being defined by moving them to the top of their scope before the execution of code begins.Following is the code showing hoisting for variables and functions in JavaScript −Example Live Demo Document ... Read More

How to import and export a module/library in JavaScript?

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:12:59

2K+ Views

Note − To run this example you will need to run a localhost server.Following is the code for importing and exporting a module/library in JavaScript −ExampleINDEX.html Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result ... Read More

Explain ‘dotAll’ flag for regular expressions in JavaScript

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:09:01

243 Views

The dotAll flag returns true or false depending upon if the s flag has been set in the regular expression or not.Following is the code to implement dotAll flag for regular expressions in JavaScript −Example Live Demo Document    body {       font-family: "Segoe ... Read More

Explain the callback Promise.finally in JavaScript

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:06:56

202 Views

The promise.finally() calls the callback function whether a promise has been fulfilled or rejected. This helps us to do something once the promise has been rejected or resolved.Following is the code for Promise.finally() in JavaScript −Example Live Demo Document    body {       font-family: ... Read More

Named capture groups JavaScript Regular Expressions

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 13:03:30

178 Views

With JavaScript, you can group s part of regular expression. This can be done by encapsulating characters in parentheses.Following is an example −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample, .result {   ... Read More

Lookbehind Assertions JavaScript Regular Expressions

AmitDiwan

AmitDiwan

Updated on 15-Jul-2020 12:57:57

161 Views

Lookbehind allows matching a pattern only if there’re something before.Following is an example −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample, .result {       font-size: 20px;       font-weight: 500; ... Read More

Advertisements