true
assert.ok('***'.length === 3)
assert.ok('😀😀😀'.length === 3)
assert.ok('***'[0] === '*')
assert.ok('😀😀😀'[0] === '😀')
assert.ok([...'***'][0] === '*')
assert.ok([...'😀😀😀'][0] === '😀')
答案
const result = 3 + 1 + ' oranges';
会发生什么?
assert.equal(result, NaN)
assert.equal(result, '4 oranges')
assert.equal(result, '31 oranges')
const result = 3 + (1 + ' oranges');
const result = 'Oranges: ' + 3 + 1;
assert.equal(result, 'Oranges: 4')
assert.equal(result, 'Oranges: 31')
const result = 'Oranges: ' + (3 + 1);
assert.ok(String(null) === 'null')
assert.ok(null.toString() === 'null')
assert.ok(String(false) === 'false')
assert.ok(false.toString() === 'false')
assert.ok(Boolean('false'))
assert.ok(String([1,2,3]) === '1,2,3')