Null and Undefined are both data types in JavaScript. Undefined is a variable that has been declared but not assigned a value. Null as an assignment value. ... However, when you assign null to a variable, you are declaring that this value is explicitly empty.