Шукаєте відповіді та рішення тестів для WEB202_Web Development 2_24/25_T2_11.CCP? Перегляньте нашу велику колекцію перевірених відповідей для WEB202_Web Development 2_24/25_T2_11.CCP в moodle.ncst.edu.bh.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
test('adds 2 + 2 to equal 4', () => {
expect(add(2, 2)).toBe(4);
});What is the output?
const nums = [2, 3, 4];
const product = nums.reduce((acc, n) => acc * n, 1);
console.log(product);
]]>Given:
const cat = {name: "Mittens", age: 5};What does cat['name'] output?]]>Context:
const arr = [1, 2, 3];
const total = arr.reduce((sum, num) => sum + num, 0);
console.log(total);
What is the output?
How can you modify this function to correctly capitalize only the first letter of a string?
function capitalize(str) {
return str.toUpperCase();
}
What is the correct way to write a function that multiplies two numbers?
Given:
const arr = [1,2,3,4];const sum = arr.reduce((a,b) => a+b, 0);What is the value of sum?]]>