Master JavaScript

Section quiz

Contents

Contents

Master JavaScript

0 of 266 complete

Section quiz

What JavaScript is, and how to run it

Nine questions on the three layers, semicolons you did not write, the eight types, the two kinds of nothing, and how a name comes to exist.

Questions are shuffled within each part, and so are the answers. You can retake it as often as you like.

0 of 9 answered

Part 1: The machine and the shape of a program

Question 1

A file begins with import { readFile } from "node:fs/promises";. Which dialect is the rest of the file in?

Question 2

Inside a function, the word return is alone on one line and total * 2; is on the line below it. What does the function give back?

Question 3

A file has const sum = a + b on one line and (a + b).toString() on the next, with no semicolons anywhere. What happens?

Question 4

Which of these names is defined by the ECMAScript specification itself, rather than supplied by whatever host is running your code?

Question 5

Which of these is not an expression?

Part 2: Values, names and absence

Question 6

function pour(ml = 250) { return ml; } is called as pour(null). What comes back?

Question 7

const user = { name: "ada" }; then user.name = "grace";. What happens on the second line?

Question 8

typeof null gives "object". What should you conclude from that?

Question 9

console.log(total); let total = 5; What do you see?

9 questions left to answer.