var obj = { text: 'ok'};
obj.missing || 'default'
"default"
obj && obj.text
"ok"
obj && print(obj);
cond && operation
idiom. This
code style avoids an if statement for short operations.
[0, 1, true, false, '', ' ', null, undefined].filter(Boolean)
[1, true, " "]
new Array(4).fill(0).map(Math.random).map(v => v * 10).map(Math.floor).join('-')
"0-1-2-3"
The console allows you to interact with the course material and examples. Use the following keys:
A special logging function is also available: