In JavaScript, `undefined` and `null` are both special values signifying “no value” or “no object”. However, they are used in slightly different scenarios.
`undefined` means that a variable has been declared, but has not yet been assigned a value. You might also get `undefined` when trying to access a non-existing object property or array element.
Example:
```
let testVar;
console.log(testVar);
// logs: undefined
console.log(nonexistentVar);
// throws an error
console.log({}[‘prop’]);
// logs: undefined
console.log([]0);
// logs: undefined
```
On the other hand, `null` is an assignment value that represents no value or no object. It implies the absence of a value intentionally and explicitly. It needs to be assigned.
Example:
```
let testVar = null;
console.log(testVar);
// logs: null
```
You can check for `undefined` and `null` through following means:
```
let testVarUndefined;
let testVarNull = null;
console.log(testVarUndefined = undefined); // logs: true console.log(testVarUndefined = null); // logs: false
console.log(testVarNull = null); // logs: true
console.log(testVarNull = undefined); // logs: false
```
In non-strict equality `==`, `undefined` and `null` are somewhat interchangeable and equal to each other:
```
console.log(undefined == null); // logs: true
```