Skip to content

Fix typos in Day 11 (Destructuring and Spreading) - #1034

Open
JaydonZhao wants to merge 21 commits into
Asabeneh:masterfrom
JaydonZhao:fix/day11-destructuring-typos
Open

Fix typos in Day 11 (Destructuring and Spreading)#1034
JaydonZhao wants to merge 21 commits into
Asabeneh:masterfrom
JaydonZhao:fix/day11-destructuring-typos

Conversation

@JaydonZhao

Copy link
Copy Markdown

Three small typo fixes in 11_day_destructuring_and_spreading.md:

  1. "skip on of the values" → "skip one of the values"
  2. Added a missing comma for readability: "When we destructure**,** the name of the variable we use..."
  3. Removed a stray //with destructuring comment at the end of the without-destructuring example — it's out of place there (the with-destructuring version already has its own ### Object parameter with destructuring section right below).

No content/logic changes, docs only.

- flat single-file structure: NN-topic.js per topic (concepts as
  comments + demo + exercises in one file), replacing the old
  NN-topic/ folder with separate notes.md + practice.js
- 00-concepts/ cross-topic notes (mistakes log, call-forms,
  value-vs-reference, shortcircuit bash-vs-js)
- move quokka_playground.js from repo root into js_notes/
- add project CLAUDE.md
- 08-sets-maps: correct 'object order not guaranteed' -> objects keep
  insertion order except integer-like keys (reordered ascending); this
  is the real reason to prefer Map when numeric keys must stay ordered
- 05-conditionals: soften 'only 6 falsy values' (note 0n/-0 exist)
- 04-strings: annotate expected output for immutable string[0]='x'
  (silent in sloppy mode, TypeError in strict/ESM)
- 04-strings: reword exercise C hint to direction-only (no full answer)
- 09-loops: fix typo in for...in comment
- 09-loops: finish exercises A-F
- 00-concepts: add semicolons-and-asi.md (when ; is mandatory: line
  starting with ( or [, no newline after return/throw)
- README: index the new concept note
- reflect single-file NN-topic.js layout (was NN-topic/ folder)
- add standing rule: preserve wrong code as ❌/✅ contrast comments
  when editing user's code, so mistakes stay visible for review
- note 'instructive mistakes only' bar for my-mistakes.md
- fix stale run command; add git remotes (fork/upstream) section
- pull async/promises forward (was ch18): every LLM call is async,
  it's the core of any agent
- add modules (import/export), a TS track, and an agent-domain +
  pi-hands-on tier
- defer browser topics (regex/DOM/events/web-storage) as pi is a
  Node CLI/TUI, not a browser app
- teach the underlying mechanism, not a bare rule; lead with the anchor
  sentence and let rules fall out as consequences
- worked example: arrow body & return anchored on '=> expects an
  expression' (user corrected an earlier {-first draft)
- prefer running code to show the real error/output
- 10-functions.js: functions chapter (declaration/expression, arrow,
  default params, return, scope, functions-as-values); arrow-return
  explained anchor-first (=> expects an expression); object-return
  needs () with a note on why it's silent (label statement)
- 09-loops.js: add label (break/continue outer) — the real feature
  behind the 'name:' collision that bites arrow object-return
- my-mistakes.md: N (block doesn't produce a value, so {} needs return)
  and O (arrow object-return needs parens); both are silent undefined
- new standing rule: put explanations directly into NN-topic.js, not
  just chat; /tmp verification is fine but conclusions must land in files
- replace stiff '锚点' wording with plainer phrasing (核心一句 etc.)
- include user's own softening of a few rule phrasings
- 10-functions.js: add hoisting/TDZ section (why names are registered but
  not touchable; var silent-undefined vs const/let TDZ error) + runnable
  demo; reword 锚点 to plainer phrasing
- my-mistakes.md: same 锚点 rewording in entry N
- 02-variables.js: undefined/null/NaN typeof cheat-table; full null
  section (independent primitive = 'intentional empty', === null to test,
  typeof null bug, placeholder use); cross-ref var pitfall to ch10
- 07-objects.js: add §0 on what an object really is (primitive vs object
  camps; arrays/functions are objects — you can attach props)
- 10-functions.js: finish exercises A-F (incl. recursive repeat in F)
- §1: note function's own name vs the variable holding it (named
  function expression's name is only visible inside → recursion/debug)
- fix E prompt (triple can't cleanly make 20; print triple(7))
- README: mark ch10 done
…sions

- F: user improved repeat to check times===0 BEFORE fn() so repeat(fn,0)
  prints 0 times; keep it live, comment the two earlier versions as ❌
  contrast (never leave duplicate live const → SyntaxError)
- my-mistakes M: add re-occurrence context (new version written but old
  not deleted → duplicate const)
- consolidate scattered end-of-topic actions into one mandatory
  checklist: verify (node run), leave ❌/✅ traces, absorb mistakes,
  update README progress, commit cleanly, point to next chapter
…races

- §6: why functions have properties (function = callable object;
  first-class → is a value/object → has props → passable); Python parallel
- experiment区: fix .name read-only misconception (silent fail), add .foo
  contrast that actually proves reference sharing; fix typo (Descriptor)
- new 00-concepts note: which has a value / can be used as a value;
  the REPL 'completion value' illusion; ties together arrow =>, ternary,
  return
- README: index it under cross-topic concepts
- shortcircuit-bash-vs-js: bash chains any command; JS operators take
  only expressions (function call/assignment ok, if/for/const → SyntaxError)
- cross-ref expression-vs-statement.md
- 11-higher-order-functions.js: chapter + exercises A-F done; E/F cleaned
  into ❌/✅ traces (^ is XOR not power; [a,b] is comma operator not slice;
  reduce without initial value avoids leading space)
- my-mistakes: add P (^ vs **) and Q (comma operator vs slice), both
  'runs but wrong'; explain comma operator; update quick-lookup table
- README: mark ch11 done
- codifies the js_notes/ wrap-up workflow: run real output, turn mistakes
  into ❌/✅ traces, fix wrong result-comments, selectively absorb into
  my-mistakes.md, flexible commit decision
- 'skip on of the values' -> 'skip one of the values'
- add missing comma: 'When we destructure, the name of the variable...'
- remove stray '//with destructuring' comment left in the without-
  destructuring example (the with-destructuring version has its own
  section below)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant