Setting a value of null is intentionally leaving the value undefined whereas a variable that has no value is set to undefined by the browser.

//null and undefined are primitive values in JavaScript
//a null or undefined value evaluates to false in conditional expression

//a null value means absence

let count = null;
//intentionally setting no value

console.log(count, count + 3, `the sum is ${count}`);
//result: null 3 "the sum is null"
//count is null
//no value + 3 = 3
//${count} is null


//an undefined value means lack of value

let counter
//awaiting a value
//browser sets counter to undefined

console.log(counter, counter + 3, `the sum is ${counter}`);
//result: undefined NaN "the sum is undefined"