[...arr, false]
const arr3 = [...arr, null]
const arr4 = [...arr, undefined]
const arr5 = [...arr, 0]
const arrsCombined = [arr, arr2, arr3, arr4, arr5]
arrsCombined.forEach(arr => console.log(arr, arr.every(Boolean)));
console.log('----')
arrsCombined.forEach(arr => console.log(arr, arr.every((el) => el === 0 ? true : Boolean(el))));
В этой
Arr.every(Boolean) ? Do(): do2()
Обсуждают сегодня