Assume that the author intended for 'aye' to print if there is a majorityVote and it is not isVetoed.
let majorityVote = true
let isVetoed = false
// ...
if ((typeof majorityVote !== 'undefined' && majorityVote === true)
&& (typeof isVetoed !== 'undefined' && isVetoed === false)) {
console.log('aye')
} else {
console.log('nay')
}Promise.resolve(42)
.then((a) => console.log(a))
.then((b) => console.log(b))Use .filter and .reduce to solve this.
const list = [/* mysterious array of numbers: 1, 3, 4 */]