What is different between Null and Undefined values in Javascript?
Dung Do Tien Feb 12 2020 546
Can anybody explain help me what is different between Null and Undefined values in Javascript?
Why? and When use it?
Have 1 answer(s) found.
- B0
Blue Jame Mar 18 2020
Great question, they are both a data type in javascript ECMA defined.
1. NUll
Use when set value for a variable, return of a function
Ex: var fullname = null;
2. UNDEFINED
Use when declare but not set any value, function but not return
Ex: var fullname;
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.