- 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 10711 Articles for Web Development
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
251 Views
In this example, we will learn how the prototype works in JavaScript. It is rare if a JavaScript developer doesn’t use the objects while developing the functions, and the objects can make a lot of work easy for developers.The prototype is also the advanced concept associated with the objects in JavaScript. Many of you have heard about the prototypes for the first time but don’t worry. We will cover all things about the prototypes in this tutorial.What does the prototype do?The prototype is the object created for every function class when the program starts execution. However, it depends on the ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
443 Views
In this tutorial, let us discuss the smart, self-overwriting, or lazy-getters in JavaScript. A getter binds the property of an object to a function, but the getter will not calculate the property value until we access it. The getter helps when we need to get some dynamic value without an explicit call. Users can follow the syntax below to work with the getters. Syntax { get prop() {} } { get [exp]() {} } The prop and the exp are the object's properties that bind to a function. 'prop' is a simple object property, and 'exp' is an expression. ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
10K+ Views
This tutorial teaches us to execute JavaScript at the command prompt.JavaScript is the most popular language among programming languages that work with the browser. It is helpful to add the behaviors to the webpage and make it attractive. So, everyone can run JavaScript efficiently in the browser, but what if they want to run JavaScript via command prompt or other terminals.Here, we have different approaches to running JavaScript at the command prompt.Using the Node.jsOne of the most popular ways to run server-side JavaScript via command prompt is the use of Node.js. Node.js is the run time environment for JavaScript. The ... Read More
![Ramu Prasad](https://www.tutorialspoint.com/assets/profiles/13539/profile/60_87996-1512650215.jpg)
189 Views
To concatenate several string, use “Array.join()” method. Here, we will concat the following strings:John Amit SachinExampleYou can try to run the following code to concat several stringsLive Demo var arr = ['Amit', 'John', 'Sachin']; document.write(arr.join(', '));
![Nitya Raut](https://www.tutorialspoint.com/assets/profiles/13573/profile/60_92249-1512715559.jpg)
193 Views
Function overloading occurs when a function performs different tasks based on a number of arguments passed to it.The best practice for function overloading with parameters is to not check the types. The code runs slower when the type is checked and it should be avoided. For this, the last parameter to the methods should be an objectAlso, do not check the argument length.ExampleHere’s an example −function display(a, b, value) { } display(30, 15, {"method":"subtract"}); display(70, 90, {"test":"equals", "val":"cost"});
![Fendadis John](https://www.tutorialspoint.com/assets/profiles/13534/profile/60_64028-1512539837.jpg)
13K+ Views
To view events fired on an element, follow the below steps in Google Chrome:Open Google Chrome and press F12 to open Dev Tools.Now go to Sources TabGo to Event Listener Breakpoints, on the right:Click on the events and interact with the target element.If the event will fire, then you will get a breakpoint in the debugger.
![usharani](https://www.tutorialspoint.com/assets/profiles/13564/profile/60_32161-1512638316.jpg)
141 Views
The yield keyword is used in JavaScript to pause and resume a generator function. The value of the expression is returned to the generator's caller.Here’s the syntax, where “exp” is the expression and the optional value is returned by “val”, which is passed to the generator's next() method.[val] = yield [exp];Here are the examples:function* displayRank () { var selPlayers= [1, 2, 3, 4]; for (var a = 0; a < selPlayers.length; a++) { yield selPlayers[i]; } }After defining a generator function, use it like the following.Here displayRank() is the generator function:var rank = displayRank(); ... Read More
![varun](https://www.tutorialspoint.com/assets/profiles/13559/profile/60_29674-1512637943.jpg)
274 Views
The immediate function executes as soon as it is defined. To understand the role of immediate function, let’s see the difference between a function and an immediate function −Here’s immediate function −(function() { var str = "display"; }()); function display() { // this returns undefined alert(str); }Here’s a function −var str = "display"; function display() { // This returns "display" alert(str); }Let’s see another example of immediate functions −var name = 'Amit'; (function(sName) { alert( 'Student name = ' + sName ); }(sName))