Why does the first snippet print 'bar'
and the second ''
?
const bar = () => {}
console.log(bar.name) // 'bar'
const bar = 1 && (() => {})
console.log(bar.name) // ''
I also note that the same behavior occurs with traditional (ie. non-arrow) functions.