What is different between Null and Undefined values in Javascript?
Dung Do Tien
Feb 12 2020
323
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.
-
0
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;
Blue Jame Mar 18 2020
If this answer is useful for you, please BY ME A COFFEE!!! I need your help to maintain blog.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.