Modern QA2026Quiz: Chapter 1
Log inJoin
1 / 2 · Book 12 · Your First Program · drill: interview Q&A⊞ allnext →Get the book →

1.9Quiz: Chapter 1

  1. What command runs a TypeScript file named test_login.ts without compiling it first?
  2. What is the difference between print(), console.log(), and how does TypeScript's output differ from JavaScript's?
  3. How do you start the Python REPL? The Node.js REPL?
  4. What does a SyntaxError tell you?
  5. Name one advantage TypeScript has over JavaScript for catching bugs.

Answers:

  1. npx tsx test_login.ts (on Node.js 24+, node test_login.ts also works via native type-stripping)
  2. print() is Python's output function. console.log() is used by both JavaScript and TypeScript. TypeScript's runtime output is identical to JavaScript -- the types are erased at runtime.
  3. Python: type python or python3. Node: type node.
  4. That the code structure is invalid -- something is misspelled, unmatched, or missing (like a closing quote or parenthesis).
  5. TypeScript catches type errors at compile time, before the code runs. JavaScript only catches them at runtime.