- 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 6685 Articles for Javascript
![Ali](https://www.tutorialspoint.com/assets/profiles/14292/profile/60_101553-1513052445.jpg)
2K+ Views
Dynamically typedDynamically typed language is called so because the type is associated with run-time values. You don’t have to specify types every time. As the name suggests, variables' types are dynamic, means even after you set a variable to a type you can change it.Some dynamically typed languages include Python, Perl, Ruby, etc.UntypedUntyped languages, also known as dynamically typed languages, are programming languages that do not make you define the type of a variable.JavaScript is untyped language. This means that a JavaScript variable can hold a value of any data type. To declare variables in JavaScript, you need to use the ... Read More
![Amit Sharma](https://www.tutorialspoint.com/assets/profiles/14294/profile/60_103411-1513053466.png)
74 Views
In JavaScript, variables are defined using the var keyword followed by the variable name. Before you use a variable in a JavaScript program, you must declare it. Variables are declared with the var keyword as follows.var rank;A data type isn’t needed in JavaScript. Variables in JavaScript are not handled like other strong typed language C++, Java, etc.Storing a value in a variable is called variable initialization. You can do variable initialization at the time of variable creation or at a later point in time when you need that variable. var name = "Amit"; var rank = 2;
![Sai Subramanyam](https://www.tutorialspoint.com/assets/profiles/13512/profile/60_68191-1512710774.jpg)
276 Views
JavaScript handling of the variable is different from other programming languages C, C++., Java, etc. Variables in JavaScript can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container. Before you use a variable in a JavaScript program, you must declare it. Variables are declared with the var keyword as follows. var rank; var points; Storing a value in a variable is called variable initialization. You can do variable initialization at the time of variable creation or at a ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
4K+ Views
In this tutorial, we will learn what “javascript: void(0)” means. In English, void means nothing. In a programming language, void means return nothing. “javascript: void(0)” is similar to void. javascript: void(0) means return undefined as a primitive value. We use this to prevent any negative effects on a webpage when we insert some expression. For example, in the case of URL hyperlinks. Hyperlinks open by reloading the page when the user clicks on the link. When you need to run some other code in such cases, you can use javascript: void(0). Let’s split javascript: void(0) with a colon. We get ... Read More
![Rahul Sharma](https://www.tutorialspoint.com/assets/profiles/14297/profile/60_102977-1513054044.jpg)
522 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 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. HHere displayRank() is the generator function −var rank = displayRank(); // // value: 1 alert(rank.next()); // value: 2 alert(rank.next()); // value: 3 alert(rank.next()); // value: 4 alert(rank.next()); // value: undefined alert(rank.next());
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
8K+ Views
In this tutorial, we will learn to check if the variable is NaN in JavaScript. The full form of the NaN is ‘not a number’. The NaN is the reserved keyword in the JavaScript which we can assign to the variable. If users are using the below method to check whether a variable is a number or not, it will not work. var a = "Hello"; let result = a == NaN; // it always returns false. As we have talked that the above method will not work to check for a number because NaN is the reserved keyword. ... Read More
![Abhishek](https://www.tutorialspoint.com/assets/profiles/545227/profile/60_599940-1667195518.jpeg)
498 Views
In this tutorial, we will learn about NaN in JavaScript. NaN is nothing more than a property of the global object which stands for Not a Number. It is mainly used to check whether the entered value is a number or not. The NaN and Number. NaN both are same, so do not confuse next time if Number. NaN is written in any program as it is similar to NaN. The NaN is a property that is rarely used in any program because it is not a good practice to use NaN to identify anything in the program. There is ... Read More
![Abhishek Kumar](https://www.tutorialspoint.com/assets/profiles/522605/profile/60_2286409-1663737781.jpeg)
3K+ Views
We use the const keyword in JavaScript to declare variables whose value can be initialized only at the time of declaration. It is similar functionality of declaring variables as the other keywords provided in JavaScript i.e. var and let. const is short for constant, meaning that the value that resides in the variable is unchangeable. The const keyword in JavaScript It is used to declare variables in JavaScript. The variables created using const follow certain rules. The variable is block scoped. This means that the scope(lifetime) of the variable depends on the place where it has been declared. This ... Read More
![Rahul Sharma](https://www.tutorialspoint.com/assets/profiles/14297/profile/60_102977-1513054044.jpg)
418 Views
The following are the future reserved words, which include ‘class’. These words are used as keywords in proposed extensions and are therefore reserved to allow for the possibility of future adoption of those extensions.class enum extends super const export ImportThe above is defined in the ECMAScript specification.In ECMAScript 6 Language Specification it is used. The class declaration creates a class −class name [extends] { // body of class }
![Johar Ali](https://www.tutorialspoint.com/assets/profiles/14293/profile/60_101691-1513053093.jpg)
91 Views
The web browser throws an error for “var null” because it is a reserved identifier.You cannot use the following literals as identifiers in ECMAScript −null frue falseundefined A property with no definition. It is not known and not a reserved identifier. Its type is undefined.nullIt is known and a reserved identifier. But “null” isn’t the same as “false”. When you will declare a variable and set it to null, then null will get printed.