3 ms·
> Broadly speaking I try to return null in JavaScript where I would have returned None in Python, and generally I'd rather be using lodash.get to force a null r
by meiraleal 8y ago
> Broadly speaking I try to return null in JavaScript where I would have returned None in Python, and generally I'd rather be using lodash.get to force a null return. I prefer to avoid programming around "undefined" in JavaScript.
Why not var kingName = foo["kingName"] || null ?
- baranovxyz 8y ago> var foo = { kingName: '' }; undefined > foo['kingName'] || null null
- meiraleal 8y ago'' defaults to null is a better default than '' been different than null (so you would have 2 different nulls).