Looking for WEB202_Web Development 2_24/25_T2_11.CCP test answers and solutions? Browse our comprehensive collection of verified answers for WEB202_Web Development 2_24/25_T2_11.CCP at moodle.ncst.edu.bh.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
How can you modify this function to correctly capitalize only the first letter of a string?
function capitalize(str) {
return str.toUpperCase();
}
Given:
const arr = [1,2,3,4];const sum = arr.reduce((a,b) => a+b, 0);What is the value of sum?]]>
Context:Merging two branches together.
What happens after executing this code?
const div = document.createElement('div');
const copy = div;
div.style.backgroundColor = 'red';
console.log(copy.style.backgroundColor);
]]>Given:
let x = 10;let y = x;y = 20;What is the value of x?]]>
What does this print?
const str = "World";
console.log(str[0]);
]]>function getHumanChoice() { const choice = prompt("Enter rock, paper, or scissors:"); return choice.trim().toLowerCase();}
What happens after clicking a button with this code?
btn.addEventListener('click', function(e) {
e.target.style.background = 'blue';
});
]]>