Module quiz: The Building Blocks of a Program :Programming with JavaScript (Meta Front-End Developer Professional Certificate) Answers 2025
1. What data type is the variable x?
var x = {}; → This is an Object
Object ✔️
Function ❌
Parameter ❌
2. Output of the code
try {
console.log('hello)
} catch(e) {
console.log('caught')
}
There is a missing ' → code won’t run → SyntaxError
Correct: Uncaught SyntaxError ✔️
Caught ❌
3. What value prints?
burger[2] → index 2 → "lettuce"
lettuce ✔️
4. How many methods does bicycle have?
Methods:
-
start
-
stop
Total: 2 ✔️
5. Output of code
throw new Error() immediately jumps to catch → prints Goodbye
Goodbye ✔️
Hello ❌
6. Missing bracket leads to which error?
SyntaxError ✔️
7. Will the following produce a string output?
add(3, "4") → “34” (string concatenation) logs a string → Yes ✔️
8. What prints?
var result; → uninitialized variable → undefined ✔️
9. str.match(“jello”)
No match → null ✔️
10. Output of code
toPrecision(300) → number precision too large → RangeError caught → prints “There was an error”
Correct: “There was an error” ✔️
📘 Summary Table
| Q | Correct Answer | ✔️ |
|---|---|---|
| 1 | Object | ✔️ |
| 2 | Uncaught SyntaxError | ✔️ |
| 3 | lettuce | ✔️ |
| 4 | 2 methods | ✔️ |
| 5 | Goodbye | ✔️ |
| 6 | SyntaxError | ✔️ |
| 7 | Yes | ✔️ |
| 8 | undefined | ✔️ |
| 9 | null | ✔️ |
| 10 | “There was an error” | ✔️ |