Write a JavaScript program to test whether a given array of integers contains 30 and 40 twice. The array length should be 0, 1, or 2
- برمجة جافاسكربت java script
- برمجة
- 2021-06-02
- ahmadghneem
الأجوبة
function twice3040(arra1) {
let a = arra1[0],
b = arra1[1];
return (a === 30 && b === 30) || (a === 40 && b === 40);
}
console.log(twice3040([30, 30]));
console.log(twice3040([40, 40]));
console.log(twice3040([20, 20]));
console.log(twice3040([30]));
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال