// Practice Set · JS Errors · guest

Guest practice: this set is not saved and does not count.

Question 1 of 5 from: JS Errors Intro

What does this log?

try {
  JSON.parse("{bad json}");
} catch (e) {
  console.log(e.name, e instanceof SyntaxError);
}
Question 2 of 5 from: JS Errors Silent

What does this log?

let result = "Not Active.";
let isActive = false;
if (isActive = true) {
  result = "Active!";
}
console.log(result, isActive);
Question 3 of 5 from: JS Errors Silent

What does this log?

const d = new Date(2026, 1, 30);
console.log(d.getMonth() + 1, d.getDate(), String(new Date("2026-13-45")));
Question 4 of 5 from: JS Error Statements

What does this log?

try {
  throw "Too big";
} catch (error) {
  console.log(typeof error, error.message);
}
try {
  throw new Error("Too big");
} catch (error) {
  console.log(typeof error, error.message);
}
Question 5 of 5 from: JS Error Object

What does this log?

function loadSettings(text) {
  try {
    return JSON.parse(text);
  } catch (err) {
    throw new Error("Could not load settings", { cause: err });
  }
}
try {
  loadSettings("{oops");
} catch (err) {
  console.log(err.message);
  console.log(err.cause.name);
}
Ready to submit?

Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.