Write a JavaScript program to check if the predicate (second argument) is truthy on all elements of a collection (first argument)
- برمجة جافاسكربت java script
- برمجة
- 2021-06-03
- ahmadghneem
الأجوبة
const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pre]);
console.log(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'));
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال