动手做Get your hands on it
练习跟着课文走 —— 每节课尾都有本课的练习。这一页是全部练习的总库,想集中刷题的时候来。 每个练习都写清了它来自哪一节,卡住了就回去看那一节。Practice follows the lessons — every lesson ends with the exercises for that lesson. This page is the whole library, for when you want to drill in one sitting. Each exercise names the lesson it came from, so you can go back when you stall.
已筛到你正在学的《地基 · 项目与语言》。想看全部就点上面的「全部」。Filtered to Foundations · project and language — the course you are on. Use “All” above to see everything.
练习Exercises
筛出 16 个练习(共 148 个) · 第 1 / 2 页。Showing 16 of 148 · page 1 / 2.下面是 react-notes-app 真实的依赖之一。它在真实的package.json 里被放在哪个字段下?
Below is one of the real dependencies of react-notes-app. Which field of the real package.json is it under?
项目里已经有 package-lock.json,你要安装依赖。下面哪些做法是对的?(多选)
The project already has a package-lock.json and you need to install the dependencies. Which of these are correct? (more than one)
这题是多选。More than one answer is correct.
下面是 node-subgraph/package.json 的骨架,挖掉了三个决定项目行为的值。 照真实文件补回来。
Below is the skeleton of node-subgraph/package.json with three values removed. Each one decides how the project behaves. Put them back the way the real file has them.
你在 react-notes-app/ 目录下,想跑那 4 个判卷测试。 package.json 的 scripts 只有 dev、build、q2。下面哪个命令能跑起来?
You are inside react-notes-app/ and want to run those 4 grading tests. The scripts in package.json are only dev, build and q2. Which command works?
把排查顺序排对。从最外层(还没开始跑)到最里层(你的代码)。
Put the checks in order, from the outermost layer (nothing has started yet) to the innermost one (your own code).
Q1 要求「表单提交后,新笔记出现在表格里」。表单是NoteForm,表格是 NoteTable,两者是兄弟。 那份笔记列表数据应该存在哪个组件里?
Q1 asks that a new note appears in the table after the form is submitted. The form is NoteForm, the table is NoteTable, and the two are siblings. Which component should hold the list of notes?
Federation 项目里,下面哪个文件与你要完成的任务完全无关?
In the Federation project, which of these files has nothing at all to do with the task you have to finish?
这是 NoteManager 里三个 handler 的真实代码, 挖掉了决定行为的关键词。想清楚每个操作要「保留多少条」再填。
This is the real code of the three handlers in NoteManager, with the words that decide the behaviour removed. Before you fill each one in, work out how many items that operation has to keep.
这一类 bug 最难查,因为它不报错。 先看现象,判断类型,再找病灶 —— 别跳步。
This kind of bug is the hardest to find, because it reports no error. Read the symptom, classify it, then locate it. Do not skip a step.
Q2 的要求原文:「The runner NEVER throws, even if some tasks reject. It resolves with an array of results IN THE SAME ORDER as tasks.」 这描述的是哪个内置方法的语义?
The exact wording of the Q2 requirement: “The runner NEVER throws, even if some tasks reject. It resolves with an array of results IN THE SAME ORDER as tasks.” Which built-in method behaves like that?
Task<T> = () => Promise<T>。 如果题目改成传一个 Promise<T>[] 进来, 会出什么问题?
Task<T> = () => Promise<T>. If the question passed in a Promise<T>[] instead, what would go wrong?
这是 subgraph 里真实的 DataLoader 批量加载函数。 两个空都关系到「异步 + 数组」的固定套路。
This is the real DataLoader batch function from the subgraph. Both blanks are part of the fixed pattern for async work over an array.