- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 9288 Articles for Object Oriented Programming
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
71 Views
The object.is() method introduced in ES6 as a way to compare two values. These two values can either be primitives or objects. It does a little better comparison than == and ===.Following is the code for object.is() in equality comparison −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: blueviolet; } Object.is() equality comparsion Click here Click on the above button to compare objects ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
889 Views
Event Bubbling − Whenever an event happens on an element, the event handlers will first run on it and then on its parent and finally all the way up to its other ancestors.Event Capturing − It is the reverse of the event bubbling and here the event starts from the parent element and then to its child element.Following is the code for event bubbling vs event capturing in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
187 Views
The JavaScript undefined property specifies if a variable has been declared or assigned a value yet.Following is the code implementing the JavaScript undefined 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 undefined property CLICK HERE CLICK the above button to know if variable age has been defined or not let sampleEle = document.querySelector(".sample"); let age; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
447 Views
Template were introduced in ES6 to allow embed expressions inside a string. Instead of ‘’ or “” quotation marks they use the backticks (``). They offer a much better way of string interpolation and expressions can be embedded in a way like ${a+b}. It offers a much nicer syntax than the + operator.Following is the code for template strings 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
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
9K+ Views
Escape characters are characters that can be interpreted in some alternate way then what we intended to. To print these characters as it is, include backslash ‘\’ in front of them. Following are the escape characters in JavaScript −CodeResult\bBackspace\fForm FeedNew Line\rCarriage Return\tHorizontal Tabulator\vVertical Tabulator\'Single quote\"Double quote\BackslashFollowing is the code implement escape character Backslash in javaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; } Escape characters in JavaScript ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
The Set data type was introduced in ES2015 and the difference between array and set is that while an array can have duplicate values a set can’t. Elements can be accessed in array using index which isn’t possible in Set since it uses keys and elements can be traversed only in the way they were entered.Following is the code displaying the difference between array and Set in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result, .sample { font-size: 18px; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
186 Views
Following is the code to pass JavaScript primitive and object types to function −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: blueviolet; } Passing primitive/object types to function Click here Click on the above button to pass primitive and object to a function and call it let BtnEle = document.querySelector(".Btn"); let resEle = document.querySelector(".result"); let person = { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
906 Views
innerHTML − The innerHTML property returns the text, including all spacing and inner element tags. It preserves the formatting of the text and all the extra tags like , etc.innerText − The innerText property returns just the text, removing the spacing and the inner element tags.Following is the code for innerHTML and innerText in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result, .sample { font-size: 18px; font-weight: 500; color: red; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
1K+ Views
Undeclared − It occurs when a variable which hasn’t been declared using var, let or const is being tried to access.Undefined − It occurs when a variable has been declared using var, let or const but isn’t given a value.Following is the code for undeclared and undefined in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: blueviolet; } Undeclared vs Undefined ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
777 Views
Following is the code for validating a file size in JavaScript while uploading −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: blueviolet; } Validating a file size while uploading Upload a file using the above file input type let BtnEle = document.querySelector(".Btn"); let resEle = document.querySelector(".result"); let fileEle = document.querySelector(".file"); function validateFile() { if ... Read More