EduFlow
JavaScript Fundamentals

Final assessment

Twelve questions across the whole course. Score 70% or more to pass and unlock your certificate. You can retake it as often as you like.

Finish every lesson to earn the certificate — you can take the assessment any time.

Question 1 of 12

What does console.log(typeof (450 + "50"), 450 - "50") print?

Question 2 of 12

What does [3, 1, 2].map((n) => n * 2).filter((n) => n > 2) return?

Question 3 of 12

An expense has no receipt property. Which expression throws?

Question 4 of 12

In what order are the letters logged?

JavaScript
setTimeout(() => console.log("A"), 0);
(async () => {
  console.log("B");
  await null;
  console.log("C");
})();
console.log("D");
Question 5 of 12

totalsByCategory uses reduce with {} as the initial value and throws Cannot read properties of undefined on the second expense. What is the most likely cause?

Question 6 of 12

Two parts of Pocket each call createIdGenerator("exp") and sometimes produce the same id. What is the right fix?

Question 7 of 12

A labels list is rendered with li.innerHTML = `<b>${label}</b>`; and a user saves the label <img src=x onerror=alert(1)>. What is the safe fix?

Question 8 of 12

getJson returns a promise that rejects. What does safeLoad() do?

JavaScript
async function safeLoad() {
  try {
    return getJson("/api/rates");
  } catch {
    return {};
  }
}
Question 9 of 12

You need amounts sorted from largest to smallest for a chart, while another panel still shows amounts in its original order. Which line is right?

Question 10 of 12

items.forEach(store.add); throws Cannot read properties of undefined (reading '#items') inside add. Which change fixes it?

Question 11 of 12

The check if (amountInput.value == 0) is meant to catch an amount of zero. Why does it also run when the field is empty?

Question 12 of 12

What happens with JSON.parse(JSON.stringify({ when: new Date() })).when.getFullYear()?

12 questions unanswered