
- MongoDB Tutorial
- MongoDB - Home
- MongoDB - Overview
- MongoDB - Advantages
- MongoDB - Environment
- MongoDB - Data Modeling
- MongoDB - Create Database
- MongoDB - Drop Database
- MongoDB - Create Collection
- MongoDB - Drop Collection
- MongoDB - Data Types
- MongoDB - Insert Document
- MongoDB - Query Document
- MongoDB - Update Document
- MongoDB - Delete Document
- MongoDB - Projection
- MongoDB - Limiting Records
- MongoDB - Sorting Records
- MongoDB - Indexing
- MongoDB - Aggregation
- MongoDB - Replication
- MongoDB - Sharding
- MongoDB - Create Backup
- MongoDB - Deployment
- MongoDB - Java
- MongoDB - PHP
- Advanced MongoDB
- MongoDB - Relationships
- MongoDB - Database References
- MongoDB - Covered Queries
- MongoDB - Analyzing Queries
- MongoDB - Atomic Operations
- MongoDB - Advanced Indexing
- MongoDB - Indexing Limitations
- MongoDB - ObjectId
- MongoDB - Map Reduce
- MongoDB - Text Search
- MongoDB - Regular Expression
- Working with Rockmongo
- MongoDB - GridFS
- MongoDB - Capped Collections
- Auto-Increment Sequence
- MongoDB Useful Resources
- MongoDB - Questions and Answers
- MongoDB - Quick Guide
- MongoDB - Useful Resources
- MongoDB - Discussion
What happens when we try to add a number to undefined value?
If you try to add a number to undefined value then you will get a NaN. The NaN defines Not a Number. Following is an example −
Case 1
var anyVar=10+undefined; print(anyVar) //Result will be NaN
Case 2
var anyVar1=10; var anyVar2; var anyVar=yourVar1+yourVar2; print(anyVar) //Result will be NaN
Case 1
Let us implement the above cases. The query is as follows −
> var result=10+undefined; > print(result);
This will produce the following output −
NaN
Case 2
Let us implement the above case −
> var value; > var value1=10; > var result=value1+value > result
This will produce the following output −
NaN
- Related Articles
- What happens when we try to add a duplicate key into a HashMap object in java?
- What happens when you add a double value to a String in java?
- What happens if we try to extend a final class in java?
- What happens when we add potassium permanganate and water?
- What happens when we type a URL?
- What happens when buffer is set to a value "none" in JSP?
- What exactly happens when we have fever?
- What happens when a negative value is inserted to UNSIGNED column in MySQL?
- What will happen when we try to override final method of the superclass in Java?
- What happens when we multiply a negative integer with a positive integer?
- What type of reaction happens when we burn salt and sugar?
- What Happens to Heart When Muscles Work Harder?
- What happens when we apply NOT NULL constraint, with ALTER TABLE statement, to a column contains NULL values?
- Setting a default variable value to undefined in a function - JavaScript?
- What happens to a PCB when the state of a process changes?

Advertisements