logo

Crowdly

Browser

Add to Chrome

WEB202_Web Development 2_24/25_T2_11.CCP

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();

}

0%
0%
0%
0%
View this question
Context:

Using .reduce on an array.

Given:

const arr = [1,2,3,4];

const sum = arr.reduce((a,b) => a+b, 0);

What is the value of sum?

]]>
0%
0%
0%
0%
View this question

Context:

Merging two branches together.

View this question
Context:

DOM manipulation and object reference.

What happens after executing this code?

const div = document.createElement('div');

const copy = div;

div.style.backgroundColor = 'red';

console.log(copy.style.backgroundColor);

]]>
0%
0%
0%
0%
View this question
Context:

Difference between primitive and object assignment.

Given:

let x = 10;

let y = x;

y = 20;

What is the value of x?

]]>
0%
0%
0%
0%
View this question
Context:

Accessing string characters using bracket notation.

What does this print?

const str = "World";

console.log(str[0]);

]]>
View this question
What should getHumanChoice() return?

Reference Code:

function getHumanChoice() {

  const choice = prompt("Enter rock, paper, or scissors:");

  return choice.trim().toLowerCase();

}

0%
0%
0%
0%
View this question
What are the two main components of an error message in JavaScript?

0%
0%
0%
0%
View this question
Context:

Changing style on click.

What happens after clicking a button with this code?

btn.addEventListener('click', function(e) {

e.target.style.background = 'blue';

});

]]>
View this question
Why is breaking a big problem into smaller subproblems beneficial?

View this question

Want instant access to all verified answers on moodle.ncst.edu.bh?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome