AmitDiwan has Published 10744 Articles

JavaScript Importing and Exporting Modules

AmitDiwan

AmitDiwan

Updated on 12-May-2020 06:24:44

297 Views

To import and export modules using JavaScript, the code is as follows −Note − To run this example you will need to run a localhost server.INDEX.htmlExample Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result ... Read More

JavaScript to generate random hex codes of color

AmitDiwan

AmitDiwan

Updated on 12-May-2020 06:19:40

272 Views

To generate random hex codes of color using JavaScript, the code is as follows −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result {       box-sizing: border-box;       font-size: 18px; ... Read More

JavaScript WebAPI File File.name Property

AmitDiwan

AmitDiwan

Updated on 12-May-2020 06:16:53

95 Views

The JavaScript File WebAPI file.name property returns only the name of the file without the path.Following is the code for the File WebApi File.name property −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .result ... Read More

JavaScript WeakSet

AmitDiwan

AmitDiwan

Updated on 12-May-2020 06:14:25

95 Views

The JavaScript WeakSet is used for storing collection of objects. Like set it doesn’t store duplicates.Methods of WeakSet −MethodDescriptionadd(obj)Append new value to the weakSet.delete(obj)Deletes the value from weakSet.has(obj)Returns true or false depending upon if the weakSet object contains the value or not.length()Returns the weakSet object lengthFollowing is the code for ... Read More

JavaScript unescape() with example

AmitDiwan

AmitDiwan

Updated on 12-May-2020 06:11:52

246 Views

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

JavaScript undefined Property

AmitDiwan

AmitDiwan

Updated on 12-May-2020 06:09:36

176 Views

The JavaScript undefined property specifies if a variable has been declared or assigned a value yet.Following is the code for the JavaScript undefined property −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample { ... Read More

JavaScript this Identifier

AmitDiwan

AmitDiwan

Updated on 12-May-2020 06:04:05

195 Views

The JavaScript this keyword refernces the object to which it belongs. It can refer to the global object if alone or inside a function. It refers to the owner object if inside a method and refers to the HTML element that received the event in an event listener.Following is the ... Read More

JavaScript source Property

AmitDiwan

AmitDiwan

Updated on 12-May-2020 05:52:30

154 Views

The JavaScript source property returns the regexp text against which a given pattern is to matched.Following is the code for the source property −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample,    .result ... Read More

JavaScript Regular Expressions

AmitDiwan

AmitDiwan

Updated on 11-May-2020 14:36:01

403 Views

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 ... Read More

JavaScript Random

AmitDiwan

AmitDiwan

Updated on 11-May-2020 14:31:17

217 Views

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 {       ... Read More

Advertisements