3 ms·
var x = {a: 1, b: undefined}; x.b and x.c are both undefined, but `'b' in x` is true, while `'c' in x` is false. You can check what keys have been provided,
by rtpg 5y ago
var x = {a: 1, b: undefined};
x.b and x.c are both undefined, but `'b' in x` is true, while `'c' in x` is false.
You can check what keys have been provided, and... well, you could use that to determine things about your data.
- JeanMeche 5y agoThis difference is illustrated by the types : { a: string, b : string | undefined } and { a: string, b?: string }