Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10740 Articles
AmitDiwan
301 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
AmitDiwan
114 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
AmitDiwan
114 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
AmitDiwan
273 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
AmitDiwan
203 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
AmitDiwan
223 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
AmitDiwan
168 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
AmitDiwan
470 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
AmitDiwan
234 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
AmitDiwan
1K+ Views
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 ... Read More