Open this example in the interactive library
Source code
const samples: unknown[] = [null, "Ada", 12, { id: 1 }, [2, 3], true];
console.log(samples.map((v) => (v === null ? "null" : typeof v)));
Sample output
[ 'null', 'string', 'number', 'object', 'object', 'boolean' ]
