From 15be1fe6bb36d76e5a86dbedbd9ea23959766d87 Mon Sep 17 00:00:00 2001 From: camperbot Date: Sat, 18 Sep 2021 11:22:53 -0700 Subject: [PATCH] chore(i18n,curriculum): update translations (#43463) --- ...end-development-and-apis-certification.yml | 2 +- ...ata-analysis-with-python-certification.yml | 2 +- .../data-visualization-certification.yml | 2 +- ...nd-development-libraries-certification.yml | 2 +- .../information-security-certification.yml | 2 +- ...thms-and-data-structures-certification.yml | 2 +- .../legacy-back-end-certification.yml | 2 +- ...egacy-data-visualization-certification.yml | 2 +- .../legacy-front-end-certification.yml | 2 +- .../legacy-full-stack-certification.yml | 12 +- ...ty-and-quality-assurance-certification.yml | 2 +- ...ine-learning-with-python-certification.yml | 2 +- .../quality-assurance-certification.yml | 2 +- .../relational-databases-certification.yml | 2 +- .../responsive-web-design-certification.yml | 2 +- ...ic-computing-with-python-certification.yml | 2 +- .../es6/prevent-object-mutation.md | 4 +- ...ay-alphabetically-using-the-sort-method.md | 4 +- .../add-font-awesome-icons-to-our-buttons.md | 2 +- ...call-out-optional-actions-with-btn-info.md | 2 +- .../bootstrap/create-a-bootstrap-button.md | 2 +- .../build-a-25-5-clock.md | 4 +- .../build-a-drum-machine.md | 4 +- .../build-a-javascript-calculator.md | 4 +- .../build-a-markdown-previewer.md | 4 +- .../build-a-random-quote-machine.md | 4 +- .../target-even-elements-using-jquery.md | 2 +- ...ml-elements-with-selectors-using-jquery.md | 2 +- .../connect-redux-to-the-messages-app.md | 6 +- .../react/introducing-inline-styles.md | 1 - .../react/render-conditionally-from-props.md | 2 +- .../react/render-html-elements-to-the-dom.md | 2 +- .../react/render-with-an-if-else-condition.md | 6 +- .../use--for-a-more-concise-conditional.md | 4 +- ...anced-javascript-in-react-render-method.md | 2 +- .../copy-an-object-with-object.assign.md | 2 +- .../redux/define-an-action-creator.md | 2 +- .../use-each-to-map-over-items-in-a-list.md | 2 +- .../exercise-tracker.md | 400 +++++++++++++++++- .../file-metadata-microservice.md | 6 +- .../request-header-parser-microservice.md | 6 +- .../timestamp-microservice.md | 8 +- .../url-shortener-microservice.md | 6 +- .../get-data-from-post-requests.md | 4 +- ...-a-root-level-request-logger-middleware.md | 4 +- .../meet-the-node-console.md | 6 +- .../add-a-version-to-your-package.json.md | 2 +- .../add-keywords-to-your-package.json.md | 2 +- ...project-with-external-packages-from-npm.md | 2 +- ...e-of-any-node.js-project-or-npm-package.md | 6 +- ...he-latest-minor-version-of-a-dependency.md | 2 +- ...he-latest-patch-version-of-a-dependency.md | 2 +- .../mongodb-and-mongoose/create-a-model.md | 2 +- .../install-and-set-up-mongoose.md | 10 +- .../parsing-html-and-saving-data.md | 2 +- .../algorithms/implement-quick-sort.md | 16 +- .../algorithms/inventory-update.md | 16 +- .../celestial-bodies-database.md | 2 +- ...sh-by-building-a-kitty-ipsum-translator.md | 2 +- ...-and-sql-by-building-a-bike-rental-shop.md | 2 +- .../learn-bash-by-building-a-boilerplate.md | 2 +- ...ash-scripting-by-building-five-programs.md | 2 +- ...git-by-building-an-sql-reference-object.md | 2 +- ...building-a-list-of-inspirational-quotes.md | 2 +- .../learn-nano-by-building-a-castle.md | 2 +- ...-databases-by-building-a-mario-database.md | 2 +- ...earn-sql-by-building-a-student-database.md | 2 +- .../number-guessing-game.md | 2 +- .../periodic-table-database.md | 2 +- .../salon-appointment-scheduler.md | 2 +- .../world-cup-database.md | 2 +- ...end-development-and-apis-certification.yml | 2 +- ...ata-analysis-with-python-certification.yml | 2 +- .../data-visualization-certification.yml | 2 +- ...nd-development-libraries-certification.yml | 2 +- .../information-security-certification.yml | 2 +- ...thms-and-data-structures-certification.yml | 2 +- .../legacy-back-end-certification.yml | 2 +- ...egacy-data-visualization-certification.yml | 2 +- .../legacy-front-end-certification.yml | 2 +- .../legacy-full-stack-certification.yml | 12 +- ...ty-and-quality-assurance-certification.yml | 2 +- ...ine-learning-with-python-certification.yml | 2 +- .../quality-assurance-certification.yml | 2 +- .../relational-databases-certification.yml | 2 +- .../responsive-web-design-certification.yml | 2 +- ...ic-computing-with-python-certification.yml | 2 +- .../es6/prevent-object-mutation.md | 4 +- ...ay-alphabetically-using-the-sort-method.md | 4 +- .../add-font-awesome-icons-to-our-buttons.md | 2 +- ...call-out-optional-actions-with-btn-info.md | 2 +- .../bootstrap/create-a-bootstrap-button.md | 2 +- .../build-a-25-5-clock.md | 4 +- .../build-a-drum-machine.md | 4 +- .../build-a-javascript-calculator.md | 4 +- .../build-a-markdown-previewer.md | 4 +- .../build-a-random-quote-machine.md | 4 +- .../target-even-elements-using-jquery.md | 2 +- ...ml-elements-with-selectors-using-jquery.md | 2 +- .../connect-redux-to-the-messages-app.md | 6 +- .../react/introducing-inline-styles.md | 1 - .../react/render-conditionally-from-props.md | 2 +- .../react/render-html-elements-to-the-dom.md | 2 +- .../react/render-with-an-if-else-condition.md | 6 +- .../use--for-a-more-concise-conditional.md | 4 +- ...anced-javascript-in-react-render-method.md | 2 +- .../copy-an-object-with-object.assign.md | 2 +- .../redux/define-an-action-creator.md | 2 +- .../use-each-to-map-over-items-in-a-list.md | 2 +- .../exercise-tracker.md | 400 +++++++++++++++++- .../file-metadata-microservice.md | 6 +- .../request-header-parser-microservice.md | 6 +- .../timestamp-microservice.md | 8 +- .../url-shortener-microservice.md | 6 +- .../get-data-from-post-requests.md | 4 +- ...-a-root-level-request-logger-middleware.md | 4 +- .../meet-the-node-console.md | 6 +- .../add-a-version-to-your-package.json.md | 2 +- .../add-keywords-to-your-package.json.md | 2 +- ...project-with-external-packages-from-npm.md | 2 +- ...e-of-any-node.js-project-or-npm-package.md | 6 +- ...he-latest-minor-version-of-a-dependency.md | 2 +- ...he-latest-patch-version-of-a-dependency.md | 2 +- .../mongodb-and-mongoose/create-a-model.md | 2 +- .../install-and-set-up-mongoose.md | 10 +- .../parsing-html-and-saving-data.md | 2 +- .../algorithms/implement-quick-sort.md | 16 +- .../algorithms/inventory-update.md | 16 +- .../celestial-bodies-database.md | 2 +- ...sh-by-building-a-kitty-ipsum-translator.md | 2 +- ...-and-sql-by-building-a-bike-rental-shop.md | 2 +- .../learn-bash-by-building-a-boilerplate.md | 2 +- ...ash-scripting-by-building-five-programs.md | 2 +- ...git-by-building-an-sql-reference-object.md | 2 +- ...building-a-list-of-inspirational-quotes.md | 2 +- .../learn-nano-by-building-a-castle.md | 2 +- ...-databases-by-building-a-mario-database.md | 2 +- ...earn-sql-by-building-a-student-database.md | 2 +- .../number-guessing-game.md | 2 +- .../periodic-table-database.md | 2 +- .../salon-appointment-scheduler.md | 2 +- .../world-cup-database.md | 2 +- ...ay-alphabetically-using-the-sort-method.md | 4 +- ...sibling-elements-a-unique-key-attribute.md | 4 +- .../react/introducing-inline-styles.md | 1 - .../learn-about-self-closing-jsx-tags.md | 2 +- ...e-re-renders-with-shouldcomponentupdate.md | 4 +- .../react/pass-a-callback-as-props.md | 6 +- .../react/pass-an-array-as-props.md | 2 +- ...ops-to-a-stateless-functional-component.md | 4 +- ...pass-state-as-props-to-child-components.md | 2 +- ...react-on-the-server-with-rendertostring.md | 2 +- ...state-in-the-user-interface-another-way.md | 2 +- .../render-state-in-the-user-interface.md | 6 +- .../react/render-with-an-if-else-condition.md | 10 +- ...ay-alphabetically-using-the-sort-method.md | 4 +- .../problem-116-red-green-or-blue-tiles.md | 14 +- .../problem-117-red-green-and-blue-tiles.md | 12 +- .../problem-118-pandigital-prime-sets.md | 8 +- .../problem-119-digit-power-sum.md | 12 +- .../problem-120-square-remainders.md | 10 +- .../problem-121-disc-game-prize-fund.md | 18 +- ...lem-75-singular-integer-right-triangles.md | 18 +- .../problem-78-coin-partitions.md | 30 +- 164 files changed, 1081 insertions(+), 372 deletions(-) diff --git a/curriculum/challenges/chinese-traditional/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml index a8eadfef22..415256a2a5 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17523bc -title: 後端開發和API證書 +title: 後端開發和 API 認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml index be995fe120..b6f4189f39 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml @@ -1,6 +1,6 @@ --- id: 5e46fc95ac417301a38fb934 -title: Python 與數據分析證書 +title: Python 與數據分析認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/data-visualization-certification/data-visualization-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/data-visualization-certification/data-visualization-certification.yml index f3ec01e7d3..5d1a5d73de 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/data-visualization-certification/data-visualization-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/data-visualization-certification/data-visualization-certification.yml @@ -1,6 +1,6 @@ --- id: 5a553ca864b52e1d8bceea14 -title: Data Visualization Certification +title: 數據可視化認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml index 6d87b27e3f..2f00a14bc8 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml @@ -1,6 +1,6 @@ --- id: 561acd10cb82ac38a17513bc -title: 前端開發庫證書 +title: 前端開發庫認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/information-security-certification/information-security-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/information-security-certification/information-security-certification.yml index 9c66ccf74b..6e22e43d8c 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/information-security-certification/information-security-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/information-security-certification/information-security-certification.yml @@ -1,6 +1,6 @@ --- id: 5e6021435ac9d0ecd8b94b00 -title: 信息安全證書 +title: 信息安全認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml index 5131fe8ce3..3fc134bc76 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml @@ -1,6 +1,6 @@ --- id: 561abd10cb81ac38a17513bc -title: JavaScript 算法和數據結構證書 +title: JavaScript 算法和數據結構認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml index 861aeba315..d6f1679673 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml @@ -1,6 +1,6 @@ --- id: 660add10cb82ac38a17513be -title: 舊版後端證書 +title: 舊版後端認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml index 550dbdee99..bb4e6e43dd 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac39a17513bc -title: 舊版數據可視化證書 +title: 舊版數據可視化認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml index a941d64765..46e865d7e9 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17513be -title: 舊版前端證書 +title: 舊版前端認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml index 1fcd394593..db49278182 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml @@ -6,19 +6,19 @@ isPrivate: true tests: - id: 561add10cb82ac38a17513bc - title: 響應式網頁設計證書 + title: 響應式 Web 設計認證 - id: 561abd10cb81ac38a17513bc - title: JavaScript 算法和數據結構證書 + title: JavaScript 算法和數據結構認證 - id: 561acd10cb82ac38a17513bc - title: 前端庫證書 + title: 前端庫認證 - id: 5a553ca864b52e1d8bceea14 - title: 數據可視化證書 + title: 數據可視化認證 - id: 561add10cb82ac38a17523bc - title: API 和微服務證書 + title: API 和微服務認證 - id: 561add10cb82ac38a17213bc - title: 舊版信息安全和質量保證證書 + title: 舊版信息安全和質量保證認證 diff --git a/curriculum/challenges/chinese-traditional/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml index 94be7d2467..421624603a 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17213bc -title: 舊版信息安全和質量保證證書 +title: 舊版信息安全和質量保證認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml index eed8e6bf72..94fc3c6688 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml @@ -1,6 +1,6 @@ --- id: 5e46fc95ac417301a38fb935 -title: Machine Learning with Python Certification +title: Python 與機器學習認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/quality-assurance-certification/quality-assurance-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/quality-assurance-certification/quality-assurance-certification.yml index eb596f80d7..0ad987e31a 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/quality-assurance-certification/quality-assurance-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/quality-assurance-certification/quality-assurance-certification.yml @@ -1,6 +1,6 @@ --- id: 5e611829481575a52dc59c0e -title: 質量保證證書 +title: 質量保證認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/relational-databases-certification/relational-databases-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/relational-databases-certification/relational-databases-certification.yml index 325bb3cffe..6038c833cb 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/relational-databases-certification/relational-databases-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/relational-databases-certification/relational-databases-certification.yml @@ -1,6 +1,6 @@ --- id: 606243f50267e718b1e755f4 -title: 關係型數據庫證書 +title: 關係數據庫認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml index a2aeb4c4de..74bcad3a11 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17513bc -title: 響應式網頁設計認證項目 +title: 響應式 Web 設計認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml b/curriculum/challenges/chinese-traditional/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml index 29ffd2867d..1a83bfbc38 100644 --- a/curriculum/challenges/chinese-traditional/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml +++ b/curriculum/challenges/chinese-traditional/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml @@ -1,6 +1,6 @@ --- id: 5e44431b903586ffb414c951 -title: Python 與科學計算證書 +title: Python 與科學計算認證 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md index 85bfb530b5..375317d777 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md @@ -10,7 +10,7 @@ dashedName: prevent-object-mutation 通過之前的挑戰可以看出,`const` 聲明並不會真的保護數據不被改變。 爲了確保數據不被改變,JavaScript 提供了一個函數 `Object.freeze`。 -當一個對象被凍結的時候,你不能再對它的屬性再進行增、刪、改的操作。 任何試圖改變對象的操作都會被阻止,卻不會報錯。 +任何更改對象的嘗試都將被拒絕,如果腳本在嚴格模式下運行,將拋出錯誤。 ```js let obj = { @@ -23,7 +23,7 @@ obj.newProp = "Test"; console.log(obj); ``` -`obj.review` 和 `obj.newProp` 賦值將導致錯誤,控制檯將顯示值 `{ name: "FreeCodeCamp", review: "Awesome" }`。 +`obj.review` 和 `obj.newProp` 賦值將導致錯誤,因爲我們的編輯器默認在嚴格模式下運行,控制檯將顯示值 `{ name: "FreeCodeCamp", review: "Awesome" }`。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md index 6d92cb21a9..81fe51f009 100644 --- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md +++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md @@ -38,7 +38,7 @@ JavaScript 的默認排序方法是 Unicode 值順序排序,有時可能會得 # --instructions-- -在 `alphabeticalOrder` 函數中使用 `sort` 方法對 `arr` 中的元素按照字母順序排列。 +在 `alphabeticalOrder` 函數中使用 `sort` 方法對 `arr` 中的元素按照字母順序排列。 該函數應返回一個排序的數組。 # --hints-- @@ -83,7 +83,7 @@ assert( function alphabeticalOrder(arr) { // Only change code below this line - + return arr // Only change code above this line } alphabeticalOrder(["a", "d", "c", "a", "z", "g"]); diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md index e3a6974757..646558205d 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md @@ -12,7 +12,7 @@ dashedName: add-font-awesome-icons-to-our-buttons # --description-- -Font Awesome 是一個非常便利的圖標庫。 我們可以通過 webfont 或矢量圖的方式來使用這些圖標。 這些圖標就和字體一樣, 不僅能通過像素單位指定它們的大小,它們也同樣會繼承父級 HTML 元素的字體大小。 +Font Awesome 是一個非常便利的圖標庫。 我們可以通過 webfont 或矢量圖的方式來使用這些圖標。 這些圖標就和字體一樣, 不僅能通過像素單位指定它們的大小,它們也同樣會繼承父級 HTML 元素的字號。 可以將 Font Awesome 圖標庫添加至任何一個 web app 中,方法很簡單,只需要在 HTML head 標籤中添加以下代碼即可: diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md index 2967be5965..38314fdea2 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md @@ -12,7 +12,7 @@ Bootstrap 有着豐富的預定義按鈕顏色。 淺藍色的 `btn-info` class 在 `Like` 按鈕下方創建包含文本 `Info` 的塊級 Bootstrap 按鈕,然後爲該按鈕添加 Bootstrap 的 `btn-info` 和 `btn-block` classes。 -注意:這些按鈕仍然需要 `btn` 和 `btn-block` classes。 +注意:這些按鈕仍然需要 `btn` 和 `btn-block` class。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md index 96e9a13ba5..a5de5b343a 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md @@ -29,7 +29,7 @@ assert( assert($('button').hasClass('btn') && $('button').hasClass('btn-default')); ``` -保證所有 `button` 元素都有一個閉合標籤。 +確保所有 `button` 元素都有閉合標籤。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md index e3da642372..2dfe4fbddf 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md @@ -10,9 +10,9 @@ dashedName: build-a-25--5-clock **目標:** 在 [CodePen.io](https://codepen.io) 上實現一個功能類似 的 App。 -在滿足以下[需求](https://en.wikipedia.org/wiki/User_story)並能通過所有測試的前提下, 可以根據自己的喜好來美化 app。 +在滿足以下 [需求](https://en.wikipedia.org/wiki/User_story) 並能通過所有測試的前提下, 賦予它你自己的個人風格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰。 不推薦使用前面沒有提到的技術,否則風險自負。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 如果使用建議的技術棧完成這個項目,我們會接受並嘗試修復相關的問題反饋。 編碼愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰;不推薦使用前面沒有提到的技術,否則風險自負。 不推薦使用前面沒有提到的技術,否則風險自擔。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復你在使用推薦技術棧創建項目時報告的問題。 編碼愉快! **需求 1:** 應該能看到一個具有`id="break-label"`屬性的元素,這個元素的內容應該是一個字符串(例如:"Break Length")。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md index 8ad0a3d61a..9442b595b5 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md @@ -10,9 +10,9 @@ dashedName: build-a-drum-machine **目標:** 在 [CodePen.io](https://codepen.io) 上實現一個功能類似 的 App。 -在滿足以下[需求](https://en.wikipedia.org/wiki/User_story)並能通過所有測試的前提下, 可以根據自己的喜好來美化 app。 +在滿足以下 [需求](https://en.wikipedia.org/wiki/User_story) 並能通過所有測試的前提下, 賦予它你自己的個人風格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰。 不推薦使用前面沒有提到的技術,否則風險自負。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復使用推薦技術棧遇到的反饋問題。 編碼愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰。 不推薦使用前面沒有提到的技術,否則風險自擔。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復你在使用推薦技術棧創建項目時報告的問題。 編碼愉快! **需求 1:** 應該可以看到一個具有 `id="drum-machine"` 屬性的外層容器,該容器包含了其它所有元素。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md index c91e376d8b..65b4749bf7 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md @@ -10,9 +10,9 @@ dashedName: build-a-javascript-calculator **目標:** 在 [CodePen.io](https://codepen.io) 上實現一個功能類似 的 App。 -在滿足以下[需求](https://en.wikipedia.org/wiki/User_story)並能通過所有測試的前提下, 可以根據自己的喜好來美化 app。 +在滿足以下 [需求](https://en.wikipedia.org/wiki/User_story) 並能通過所有測試的前提下, 賦予它你自己的個人風格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰。 不推薦使用前面沒有提到的技術,否則風險自負。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復使用推薦技術棧遇到的反饋問題。 編碼愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰;不推薦使用前面沒有提到的技術,否則風險自負。 不推薦使用前面沒有提到的技術,否則風險自擔。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復你在使用推薦技術棧創建項目時報告的問題。 編碼愉快! **需求 1:** 計算器應該包含一個具有 `id="equals"` 屬性的可以點擊的元素,元素的文本內容爲 `=`(等於符號)。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md index 3a7813b002..0015175c5f 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md @@ -10,9 +10,9 @@ dashedName: build-a-markdown-previewer **目標:** 在 [CodePen.io](https://codepen.io) 上實現一個功能類似 的 App。 -在滿足以下[需求](https://en.wikipedia.org/wiki/User_story)並能通過所有測試的前提下, 你可以根據自己的喜好來美化 app。 +在滿足以下 [需求](https://en.wikipedia.org/wiki/User_story) 並能通過所有測試的前提下, 賦予它你自己的個人風格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰。 不推薦使用前面沒有提到的技術,否則風險自負。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復使用推薦技術棧遇到的反饋問題。 編碼愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰;不推薦使用前面沒有提到的技術,否則風險自負。 不推薦使用前面沒有提到的技術,否則風險自擔。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復你在使用推薦技術棧創建項目時報告的問題。 編碼愉快! **需求 1:** 應該能看到一個具有 `id="editor"` 屬性的 `textarea` 元素。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md index b822ba4c6b..27d44eb763 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md @@ -10,9 +10,9 @@ dashedName: build-a-random-quote-machine **目標:** 在 [CodePen.io](https://codepen.io) 上實現一個功能類似 的 App。 -在滿足以下[需求](https://en.wikipedia.org/wiki/User_story)並能通過所有測試的前提下, 可以根據自己的喜好來美化 app。 +在滿足以下 [需求](https://en.wikipedia.org/wiki/User_story) 並能通過所有測試的前提下, 賦予它你自己的個人風格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰。 不推薦使用前面沒有提到的技術,否則風險自擔。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復使用推薦技術棧遇到的反饋問題。 編碼愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 來完成這個挑戰。 但鑑於這個章節的學習內容與前端框架相關,推薦使用一款前端框架(比如 React)來完成這個挑戰;不推薦使用前面沒有提到的技術,否則風險自負。 不推薦使用前面沒有提到的技術,否則風險自擔。 我們有計劃新增其他前端框架課程,例如 Angular 和 Vue,不過目前還沒有這些內容。 我們會接受並嘗試修復你在使用推薦技術棧創建項目時報告的問題。 編碼愉快! **需求 1:** 應該能看到一個具有 `id="quote-box"` 屬性的包裹元素。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md index 0b35b799bc..62e3c4f158 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md @@ -39,7 +39,7 @@ assert( assert(code.match(/\:even/g)); ``` -應該僅用 jQuery 給元素添加 class。 +應該僅用 jQuery 給標籤添加 class。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md index ba5f28e6ec..2ee6c99351 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md @@ -33,7 +33,7 @@ $("button").addClass("animated bounce"); assert($('button').hasClass('animated') && $('button').hasClass('bounce')); ``` -應該僅用 jQuery 給元素添加 class。 +應該僅用 jQuery 給標籤添加 class。 ```js assert(!code.match(/class.*animated/g)); diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md index 30f49c7e34..c41f2922a7 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md @@ -18,7 +18,7 @@ dashedName: connect-redux-to-the-messages-app # --hints-- -`AppWrapper` 應渲染該頁面上。 +`AppWrapper` 應該渲染該到頁面上。 ```js assert( @@ -29,7 +29,7 @@ assert( ); ``` -`Presentational` 組件應該渲染到頁面上。 +`Presentational` 應該渲染到頁面上. ```js assert( @@ -70,7 +70,7 @@ assert( ); ``` -`Presentational` 組件應接收創建 action 的函數 `submitMessage` 屬性。 +`Presentational` 組件應接收創建 action 的函數的 `submitMessage` 屬性。 ```js assert( diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/introducing-inline-styles.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/introducing-inline-styles.md index 260a7f2f33..9b204b832f 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/introducing-inline-styles.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/introducing-inline-styles.md @@ -31,7 +31,6 @@ JSX 元素使用 `style` 屬性,但是鑑於 JSX 的編譯方式,不能將 在代碼編輯器中給 `div` 添加一個 `style` 屬性,將文本顏色設置爲紅色,字體大小設置爲 `72px`。 請注意,可以選擇將字體大小設置爲數字,省略單位 `px`,或者將其寫爲 `72px`。 - # --hints-- 組件應該渲染一個 `div` 元素。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md index 5ae10a6372..3e74ea1d38 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-conditionally-from-props.md @@ -8,7 +8,7 @@ dashedName: render-conditionally-from-props # --description-- -到目前爲止,你已經看到如何使用 `if/else`、`&&` 以及三元運算符(`condition ? expressionIfTrue : expressionIfFalse`)在不同條件下運行不同的代碼。 然而,還有一個重要的話題需要討論,將這些概念中的任何一個或所有概念與另一個強大的 React 功能 props 結合起來。 使用 props 有條件地渲染代碼在 React 開發人員中很常見——也就是說:他們使用給定 prop 的值來自動決定渲染什麼。 +到目前爲止,已經看到了如何使用 `if/else`、`&&`和三元運算符(`condition ? expressionIfTrue : expressionIfFalse`)對渲染什麼和何時渲染做出有條件的判定。 然而,還有一個重要的話題需要討論,將這些概念中的任何一個或所有概念與另一個強大的 React 功能 props 結合起來。 使用 props 有條件地渲染代碼在 React 開發人員中很常見——也就是說:他們使用給定 prop 的值來自動決定渲染什麼。 在這個挑戰中,將設置一個子組件來根據 props 做出渲染決定。 可以使用三元運算符,但是可以看到過去幾個挑戰中涵蓋的其他幾個概念在這種情況下可能同樣有用。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md index dfc0436908..4bfe98f232 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md @@ -16,7 +16,7 @@ ReactDOM 提供了一個簡單的方法來將 React 元素呈現給 DOM,如下 # --instructions-- -代碼編輯器有一個簡單的 JSX 組件。 使用 `ReactDOM.render()` 方法將該組件渲染到頁面。 可以將定義好的 JSX 元素直接作爲第一個參數傳入,然後使用 `document.getElementById()` 來選擇要渲染到的 DOM 節點, 在這個挑戰中,請渲染到 `id='challenge-node'` 的 `div` 中。 確保沒有修改 `JSX` 常量。 +代碼編輯器有一個簡單的 JSX 組件。 使用 `ReactDOM.render()` 方法將該組件渲染到頁面。 可以將定義好的 JSX 元素直接作爲第一個參數傳入,然後使用 `document.getElementById()` 來選擇要渲染到的 DOM 節點, 在這個挑戰中,請渲染到 `id='challenge-node'`的 `div` 中。 確保沒有修改 `JSX` 常量。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-with-an-if-else-condition.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-with-an-if-else-condition.md index 81b288bbc0..d6da0b068c 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-with-an-if-else-condition.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/render-with-an-if-else-condition.md @@ -18,7 +18,7 @@ MyComponent 的 state 中包含一個 `boolean`(布爾值),用於跟蹤是 # --hints-- -`MyComponent` 應該存在並被渲染。 +`MyComponent` 應該存在並渲染。 ```js assert( @@ -29,7 +29,7 @@ assert( ); ``` -當 `display` 被設置爲 `true` 時,`div`、`button` 和 `h1` 標籤應該被渲染。 +當 `display` 被設置爲 `true` 時,`div`、`button` 和 `h1` 標籤應該渲染。 ```js async () => { @@ -50,7 +50,7 @@ async () => { }; ``` -當 `display` 被設置爲 `false` 時,只有 `div` 和 `button` 應該被渲染。 +當 `display` 被設置爲 `false` 時,只有 `div` 和 `button` 應該渲染。 ```js async () => { diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md index 355b77e33c..c6aeedf2b5 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036185 -title: Use && for a More Concise Conditional +title: 使用 && 獲得更簡潔的條件 challengeType: 6 forumTopicId: 301413 dashedName: use--for-a-more-concise-conditional @@ -8,7 +8,7 @@ dashedName: use--for-a-more-concise-conditional # --description-- -`if/else` 語句在上一次挑戰中是有效的,但是有一種更簡潔的方法可以達到同樣的結果。 假設正在跟蹤組件中的幾個條件,並且希望根據這些條件中的每一個來渲染不同的元素。 如果你寫了很多 `else if` 語句來返回稍微不同的 UI,你可能會寫很多重複代碼,這就留下了出錯的空間。 相反,你可以使用 `&&` 邏輯運算符以更簡潔的方式執行條件邏輯。 這是完全可行的,因爲你希望檢查條件是否爲 `true`。如果是,則返回一些標記。 這裏有一個例子: +`if/else` 語句在上一次挑戰中是有效的,但是有一種更簡潔的方法可以達到同樣的結果。 假設正在跟蹤組件中的幾個條件,並且希望根據這些條件中的每一個來渲染不同的元素。 如果你寫了很多 `else if` 語句來返回稍微不同的 UI,你可能會寫很多重複代碼,這就留下了出錯的空間。 相反,你可以使用 `&&` 邏輯運算符以更簡潔的方式執行條件邏輯。 這是完全可行的,因爲你希望檢查條件是否爲 `true`。如果是,則返回一些標記。 下面是一個示例: ```jsx {condition &&

markup

} diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md index 17a234270d..daf20500e1 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md @@ -8,7 +8,7 @@ dashedName: use-advanced-javascript-in-react-render-method # --description-- -在之前的挑戰中,學習瞭如何使用大括號 `{ }` 將 JavaScript 代碼插入到 JSX 代碼中,用於訪問 props、傳遞 props、訪問 state、在代碼中插入註釋以及最近學習的定製組件樣式等任務。 這些都是將 JavaScript 放在 JSX 中的常見用例,但是在 React 組件中使用 JavaScript 代碼還有其他方式。 +在之前的挑戰中,你學習瞭如何使用大括號 `{ }` 將 JavaScript 代碼插入到 JSX 代碼中,用於訪問 props、傳遞 props、訪問 state、在代碼中插入註釋以及最近學習的定製組件樣式等任務。 這些都是將 JavaScript 放在 JSX 中的常見用例,但是在 React 組件中使用 JavaScript 代碼還有其他方式。 在 `render` 方法中編寫 JavaScript,可以把 JavaScript 直接放在 `return` 語句之前,而***不必***將其插入大括號中。 這是因爲它還不在 JSX 代碼中。 如果之後想在 `return` 語句中的 JSX 代碼*裏面*使用變量時,可以將變量名放在大括號中。 diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md index 69b842096b..c311a408c0 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md @@ -8,7 +8,7 @@ dashedName: copy-an-object-with-object-assign # --description-- -最後幾個挑戰適用於數組,但是當狀態是 `object` 時,有一些方法可以實現狀態不變性。 處理對象的一個常用的方法是 `Object.assign()`。 `Object.assign()` 獲取目標對象和源對象,並將源對象中的屬性映射到目標對象。 任何匹配的屬性都會被源對象中的屬性覆蓋。 通常用於通過傳遞一個空對象作爲第一個參數,然後是要用複製的對象來製作對象的淺表副本。 這是一個例子: +最後幾個挑戰適用於數組,但是當狀態是 `object` 時,有一些方法可以實現狀態不變性。 處理對象的一個常用的方法是 `Object.assign()`。 `Object.assign()` 獲取目標對象和源對象,並將源對象中的屬性映射到目標對象。 任何匹配的屬性都會被源對象中的屬性覆蓋。 通常用於通過傳遞一個空對象作爲第一個參數,然後是要用複製的對象來製作對象的淺表副本。 下面是一個示例: ```js const newObject = Object.assign({}, obj1, obj2); diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/define-an-action-creator.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/define-an-action-creator.md index 81cc4fc3d9..f8259b76c9 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/define-an-action-creator.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/redux/define-an-action-creator.md @@ -8,7 +8,7 @@ dashedName: define-an-action-creator # --description-- -創建 action 後要將 action 發送到 Redux store,以便它可以更新其狀態。 在 Redux 中,可以定義動作創建器來完成此任務, action creator 只是一個返回動作的 JavaScript 函數, 換句話說,action creator 創建表示動作事件的對象。 +創建 action 後要將 action 發送到 Redux store,以便它可以更新其狀態。 在 Redux 中,可以定義動作創建器來完成此任務, action creator 只是一個返回動作的 JavaScript 函數。 換句話說,action creator 創建表示動作事件的對象。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md index 1e89a7791a..db902094bc 100644 --- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md +++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md @@ -16,7 +16,7 @@ dashedName: use-each-to-map-over-items-in-a-list } ``` -map 的語法略有不同。 這是一個例子: +map 的語法略有不同。 這是一個示例: ```scss $colors: (color1: blue, color2: red, color3: green); diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md index 2a659420dd..1c3565beb2 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md @@ -1,6 +1,6 @@ --- id: 5a8b073d06fa14fcfde687aa -title: Exercise 追蹤器 +title: 運動追蹤器 challengeType: 4 forumTopicId: 301505 dashedName: exercise-tracker @@ -8,13 +8,55 @@ dashedName: exercise-tracker # --description-- -構建一個 JavaScript 的全棧應用,在功能上與這個應用相似: 。 可以採用下面的一種方式完成這個挑戰: +構建一個 JavaScript 的全棧應用,在功能上與這個應用相似: 。 在這個項目中,你將使用以下方法之一編寫你的代碼: - 克隆 [GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/) 並在本地完成你的項目。 - 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-exercisetracker)來完成你的項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 + +# --instructions-- + +你的答案應該有以下結構。 + +運動: + +```js +{ + username: "fcc_test" + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +用戶: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +日誌: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**提示:** 對於 `date` 屬性,`Date` API 的 `toDateString` 方法可以用於實現預期的輸出。 # --hints-- @@ -29,7 +71,24 @@ dashedName: exercise-tracker }; ``` -可以將表單裏的 `username` 通過 `POST` 請求發送到 `/api/users`,以創建一個新的用戶。 返回的響應內容是一個帶有 `username` 和 `_id` 的對象 +可以將表單裏的 `username` 通過 `POST` 請求發送到 `/api/users`,以創建一個新的用戶。 + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +`POST /api/users` 帶有表單數據 `username` 對請求,返回的響應將是一個具有 `username` 和 `_id` 屬性的對象. ```js async (getUserInput) => { @@ -49,24 +108,89 @@ async (getUserInput) => { }; ``` -可以發送 `GET` 請求到 `/api/users`,以獲取一個所有用戶的數組, 數組裏的每個元素都是一個包含 `username` 和 `_id` 的用戶對象。 +你可以向 `/api/users` 發出 `GET` 請求以獲取所有用戶的列表。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +對 `/api/users` 的 `GET` 請求返回一個數組。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +從 `GET /api/users` 返回的數組中的每個元素都是一個對象字面量,包含用戶的 `username` 和 `_id`。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +你能用表單裏的 `description`、`duration` 和 `date`(可選)發送 `POST` 請求到 `/api/users/:_id/exercises`。 如果沒有傳入 date,默認採用當前日期。 ```js async (getUserInput) => { const url = getUserInput('url'); - const res = await fetch(url + '/api/users'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }); if (res.ok) { - const data = await res.json(); - assert.isArray(data); - assert.isString(data[0].username); - assert.isString(data[0]._id); + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; } else { throw new Error(`${res.status} ${res.statusText}`); } }; ``` -你能用表單裏的 `description`、`duration` 和 `date`(可選)發送 `POST` 請求到 `/api/users/:_id/exercises`。 如果沒有傳入 date,默認採用當前日期。 響應內容是包含 exercise 表單內容的 user 對象。 +從 `POST /api/users/:_id/exercises` 返回的響應將是添加了運動字段的用戶對象。 ```js async (getUserInput) => { @@ -93,6 +217,9 @@ async (getUserInput) => { if (addRes.ok) { const actual = await addRes.json(); assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); } else { throw new Error(`${addRes.status} ${addRes.statusText}`); } @@ -102,7 +229,7 @@ async (getUserInput) => { }; ``` -可以發送 `GET` 請求到 `/api/users/:_id/logs`,以獲取任何用戶的完整 exercise 日誌。 響應內容是一個 user 對象,它帶有一個 `log` 屬性,該屬性的值是所有被添加的 exercises 表單記錄組成的數組, 每一個 log 數組裏的元素應該是一個含有 `description`、`duration` 和 `date` 等屬性的對象。 +可以發送 `GET` 請求到 `/api/users/:_id/logs`,以獲取任何用戶的完整 exercise 日誌。 ```js async (getUserInput) => { @@ -128,13 +255,10 @@ async (getUserInput) => { }); if (addRes.ok) { const logRes = await fetch(url + `/api/users/${_id}/logs`); - if (logRes.ok) { - const { log } = await logRes.json(); - assert.isArray(log); - assert.equal(1, log.length); - } else { - throw new Error(`${logRes.status} ${logRes.statusText}`); - } + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; } else { throw new Error(`${addRes.status} ${addRes.statusText}`); } @@ -144,7 +268,7 @@ async (getUserInput) => { }; ``` -用戶日誌請求(`/api/users/:_id/logs`)返回一個帶有 `count` 屬性的對象,該屬性反映 exercises 表單的成功提交次數(譯者注:即 log 屬性元素的個數)。 +對用戶日誌的請求 `GET /api/users/:_id/logs` 返回一個用戶對象,該對象具有一個 `count` 屬性,表示屬於該用戶的運動次數。 ```js async (getUserInput) => { @@ -185,7 +309,239 @@ async (getUserInput) => { }; ``` -可以把 `from`、`to` 和 `limit` 參數添加到一個 `/api/users/:_id/logs` 請求,以查詢該用戶的部分 exercise 表單提交記錄, `from` 和 `to` 是 `yyyy-mm-dd` 形式的日期, `limit` 是希望返回的 log 數量。 +對 `/api/users/:id/logs` 的 `GET` 請求將返回用戶對象,其中包含添加的所有練習的 `log` 數組。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +從 `GET /api/users/:id/logs` 返回的 `log` 數組中的每一項都是一個應該具有 `description` 的對象, `duration` 和 `date` 屬性。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +從 `GET /api/users/:id/logs` 返回的 `log` 數組中任何對象的 `description` 屬性都應該是一個字符串。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users/', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substr(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +從 `GET /api/users/:id/logs` 返回的 `log` 數組中任何對象的 `duration` 屬性都應該是一個數字。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users/', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substr(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +從 `GET /api/users/:id/logs` 返回的 `log` 數組中任何對象的 `date` 屬性應該是一個字符串。 使用 `Date` API 的 `dateString` 格式。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users/', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substr(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +你可以將 `from`、`to` 和 `limit` 參數添加到 `GET /api/users/:_id/logs` 請求檢索任何用戶的部分日誌。 `from` 和 `to` 是 `yyyy-mm-dd` 形式的日期, `limit` 是希望返回的 log 數量。 ```js async (getUserInput) => { diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md index b6aa6d7e1a..6e5b037906 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md @@ -8,13 +8,13 @@ dashedName: file-metadata-microservice # --description-- -構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 可以採用下面的一種方式完成這個挑戰: +構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 在這個項目中,你將使用以下方法之一編寫你的代碼: - 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) 並在本地完成項目。 - 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-filemetadata)來完成你的項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md index 0e0925e522..cf0680a488 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md @@ -8,13 +8,13 @@ dashedName: request-header-parser-microservice # --description-- -構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 可以採用下面的一種方式完成這個挑戰: +構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 在這個項目中,你將使用以下方法之一編寫你的代碼: - 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-headerparser/) 並在本地完成項目。 - 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-headerparser)來完成你的項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md index 29932cd9a6..72d8ee887d 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md @@ -8,13 +8,13 @@ dashedName: timestamp-microservice # --description-- -構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 可以採用下面的任意一種方式完成這個挑戰: +構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 在這個項目中,你將使用以下方法之一編寫你的代碼: -- 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-timestamp/) 並在本地完成項目。 +- 克隆 [這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-project-timestamp/) 並在本地完成項目。 - 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-timestamp)來完成你的項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md index a66168677f..969854de3a 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md @@ -8,13 +8,13 @@ dashedName: url-shortener-microservice # --description-- -構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 可以採用下面的任意一種方式完成這個挑戰: +構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:。 在這個項目中,你將使用以下方法之一編寫你的代碼: - 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) 並在本地完成項目。 - 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-urlshortener)來完成你的項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 # --instructions-- diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md index 8f5632fb89..030756be1b 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md @@ -18,11 +18,11 @@ dashedName: get-data-from-post-requests POST(有時候是 PUT)- 使用請求發送信息,以創建新資源; -GET- 讀取不用修改的已存在的資源; +GET - 讀取不用修改的已存在的資源; PUT 或者 PATCH(有時候是 POST)- 發送數據,以更新資源; -DELETE=> 刪除一個資源。 +DELETE => 刪除一個資源。 還有其他兩種方法常用於與服務進行交互。 除了 GET 之外,上面列出的所有方法都可以負載數據(即數據都能放到消息正文中), 這些方法也可以使用 body-parser 中間件。 diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md index 5fc3593fb9..fd8bf21220 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md @@ -10,7 +10,7 @@ dashedName: implement-a-root-level-request-logger-middleware 前面我們介紹了 `express.static()` 中間件函數, 現在是時候更詳細地瞭解什麼是中間件了。 中間件函數是一個接收 3 個參數的函數,這 3 個參數分別是:請求對象、響應對象和在應用的請求-響應循環中的下一個函數。 中間件函數執行一些可能對應用程序產生一些效果的代碼,通常還會在請求對象或者響應對象裏添加一些信息, 它們也可以在滿足某些條件時通過發送響應來結束循環, 如果在它們完成時沒有發送響應,那麼就會開始執行堆棧中的下一個函數, `next()` 將觸發調用第 3 個參數。 -看看下面的例子: +請看以下示例: ```js function(req, res, next) { @@ -25,7 +25,7 @@ function(req, res, next) { 構建一個簡單的日誌記錄器。 對於每個請求,它應該在控制檯中打印一個採用以下格式的字符串:`method path - ip`, 例如:`GET /json - ::ffff:127.0.0.1`。 注意 `method` 和 `path` 之間有一個空格,並且 `path` 和 `ip` 中間的破折號的兩邊都有空格。 可以使用 `req.method`、`req.path` 和 `req.ip` 從請求對象中分別獲取請求方法(http 動詞)、路由相對路徑和請求者的 ip 信息。 當你完成時,記得要調用 `next()`,否則服務器將一直處於掛起狀態。 請確保“Logs”是打開的,觀察一下當一些請求到達時會發生什麼事情。 -**注意:**Express 按照函數在代碼中出現的順序來執行, 中間件也是如此。 如果你想讓中間件函數適用於所有路由,那麼應該在路由之前配置好中間件。 +**注意:** Express 按照函數在代碼中出現的順序來執行, 中間件也是如此。 如果你想讓中間件函數適用於所有路由,那麼應該在路由之前配置好中間件。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md index 33918f7b53..d088c0c0d8 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md @@ -8,13 +8,13 @@ dashedName: meet-the-node-console # --description-- -可以採用下面的任意一種方式完成這些挑戰: +你可以採用下面的任意一種編寫代碼的方式來完成這些挑戰: - 克隆 [這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-express/) 並在本地完成項目。 - 使用[我們的 Repl.it 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-express)來完成項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 在開發過程中,能夠隨時看到代碼的運行結果是非常重要的。 diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md index c1b11624ce..a5b3ac8a55 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md @@ -8,7 +8,7 @@ dashedName: add-a-version-to-your-package-json # --description-- -`version` 是 package.json 文件中必填字段之一, 這個字段描述了當前項目的版本, 如: +`version` 是 package.json 文件中必填字段之一, 這個字段描述了當前項目的版本, 下面是一個示例: ```json "version": "1.2.0", diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md index 6883d8835b..41f795f706 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md @@ -8,7 +8,7 @@ dashedName: add-keywords-to-your-package-json # --description-- -在 `keywords` 字段中可以使用相關的關鍵字描述項目。 例如: +在 `keywords` 字段中可以使用相關的關鍵字描述項目。 下面是一個示例: ```json "keywords": [ "descriptive", "related", "words" ], diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md index 18c8345184..9d2c43c7e0 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md @@ -28,7 +28,7 @@ dashedName: expand-your-project-with-external-packages-from-npm # --hints-- -“dependencies”應該包含“moment” +“dependencies”字段應該包含“moment” ```js (getUserInput) => diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md index fefc7cb8c6..3d4cda93da 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md @@ -8,13 +8,13 @@ dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-packa # --description-- -可以採用下面的任意一種方式完成這些挑戰: +你可以採用下面的任意一種編寫代碼的方式來完成這些挑戰: - 克隆 [GitHub repo](https://github.com/freeCodeCamp/boilerplate-npm/) 並在本地完成項目。 - 使用[我們的 Replit 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-npm)來完成項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。 `package.json` 文件是所有 Node.js 項目和 npm 包的樞紐, 和 HTML 文檔中的 <head> 區域用來描述網頁的配置信息(元數據)一樣,它存儲項目的相關信息。 它由單個 JSON 對象組成,並以鍵值對的形式存儲項目信息, 且至少包含兩個必填字段:“name”和“version”——但是最好提供有關項目的其他信息,這將對用戶或者維護者有所幫助。 diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md index 66d344ff2a..46e0d795a5 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md @@ -22,7 +22,7 @@ dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-depende 在依賴項中,使用脫字符(`^`)爲 moment 的版本添加前綴,允許 npm 更新依賴包到任意新的次版本。 -**注意:**原來的版本號不用更改。 +**注意:** 原來的版本號不用更改。 # --hints-- diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md index b8d28830fc..a04432549c 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md @@ -26,7 +26,7 @@ dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a- # --hints-- -“dependencies”應該包含“moment” +“dependencies”字段中應包含“moment” ```js (getUserInput) => diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md index a4b5dfed38..99acff5552 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md @@ -8,7 +8,7 @@ dashedName: create-a-model # --description-- -**C**RUD 第一小節——CREATE +**C** RUD 第一小節——CREATE 首先,我們需要一個 Schema, 每一個 Schema 都對應一個 MongoDB 的 collection, 並且在相應的 collection 裏定義 documents 的“樣子”。 Schema 用於組成模型(Model), 我們甚至可以通過嵌套 Schema 來創建複雜的模型。目前我們先從簡。 我們可以根據模型創建實例,模型實例化後的對象稱爲 documents。 diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md index 0e7dc18f44..4c3ef69912 100644 --- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md +++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md @@ -8,13 +8,13 @@ dashedName: install-and-set-up-mongoose # --description-- -可以採用下面的任意一種方式完成這些挑戰: +你可以採用下面的任意一種編寫代碼的方式來完成這些挑戰: -- 克隆 [GitHub repo](https://github.com/freeCodeCamp/boilerplate-mongomongoose/) 並在本地完成項目。 +- 克隆 [這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-mongomongoose/) 並在本地完成項目。 - 使用[我們的 Replit 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-mongomongoose)來完成項目。 -- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。 +- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。 -當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 +完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 字段中提交它的 URL。 在這個挑戰中,你將建立一個 MongoDB Atlas 數據庫並導入連接到它所需的軟件包。 @@ -22,7 +22,7 @@ dashedName: install-and-set-up-mongoose # --instructions-- -將 `mongodb` 和 `mongoose` 添加到項目的 `package.json` 文件中。 然後,在 `myApp.js` 文件中請求 `mongoose`。 創建一個 `.env` 文件,給它添加一個 `MONGO_URI` 變量。 變量的值爲你的 MongoDB Atlas 數據庫 URI。 應用單引號或雙引號包裹 URI。請記住,環境變量 `=` 兩邊不能有空格。 例如,`MONGO_URI='VALUE'`。 完成後,使用下面的代碼來連接數據庫。 +將 `mongodb@~3.6.0` 和 `mongoose@~5.4.0` 添加到項目的 `package.json` 中。 然後,在 `myApp.js` 文件中請求 `mongoose`。 創建一個 `.env` 文件,給它添加一個 `MONGO_URI` 變量。 變量的值爲你的 MongoDB Atlas 數據庫 URI。 應用單引號或雙引號包裹 URI。請記住,環境變量 `=` 兩邊不能有空格。 例如,`MONGO_URI='VALUE'`。 完成後,使用下面的代碼來連接數據庫。 ```js mongoose.connect(, { useNewUrlParser: true, useUnifiedTopology: true }); diff --git a/curriculum/challenges/chinese-traditional/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md b/curriculum/challenges/chinese-traditional/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md index 0c2b38b7d1..6b6a358bdd 100644 --- a/curriculum/challenges/chinese-traditional/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md +++ b/curriculum/challenges/chinese-traditional/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md @@ -19,7 +19,7 @@ dashedName: parsing-html-and-saving-data ## --text-- -爲了解析 HTML 文本和提取表格,`.read_html()` 位於哪個 Python 的庫? +哪個 Python 庫有 `.read_html()` 方法,我們可以用於解析 HTML 文檔和提取表格? ## --answers-- diff --git a/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/implement-quick-sort.md b/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/implement-quick-sort.md index 53ac770885..38c26a7562 100644 --- a/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/implement-quick-sort.md +++ b/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/implement-quick-sort.md @@ -1,6 +1,6 @@ --- id: 587d825a367417b2b2512c89 -title: Implement Quick Sort +title: 實現快速排序 challengeType: 1 forumTopicId: 301615 dashedName: implement-quick-sort @@ -8,21 +8,21 @@ dashedName: implement-quick-sort # --description-- -Here we will move on to an intermediate sorting algorithm: quick sort. Quick sort is an efficient, recursive divide-and-conquer approach to sorting an array. In this method, a pivot value is chosen in the original array. The array is then partitioned into two subarrays of values less than and greater than the pivot value. We then combine the result of recursively calling the quick sort algorithm on both sub-arrays. This continues until the base case of an empty or single-item array is reached, which we return. The unwinding of the recursive calls return us the sorted array. +在這裏,我們將繼續討論中間排序算法:快速排序。 快速排序是對數組進行排序的一種有效的,遞歸的分而治之的方法。 在此方法中,在原始數組中選擇一個樞軸值。 然後將該數組分成兩個小於和大於數值的子數組。 然後,我們在兩個子陣列上結合遞歸調用快速排序算法的結果。 這一直持續到達到空或單項數組的基本情況,我們返回。 遞歸調用的展開將返回已排序的數組。 -Quick sort is a very efficient sorting method, providing *O(nlog(n))* performance on average. It is also relatively easy to implement. These attributes make it a popular and useful sorting method. +快速排序是一種非常有效的排序方法,平均提供 *O(nlog(n))* 的性能。 它也相對容易實現。 這些屬性使其成爲一種流行且有用的排序方法。 -**Instructions:** Write a function `quickSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. While the choice of the pivot value is important, any pivot will do for our purposes here. For simplicity, the first or last element could be used. +**說明:** 編寫一個函數 `quickSort`,它將整數數組作爲輸入,並按從最小到最大的排序順序返回這些整數的數組。 雖然樞軸值的選擇很重要,但任何樞軸都可以滿足我們的目的。 爲簡單起見,可以使用第一個或最後一個元素。 # --hints-- -`quickSort` should be a function. +`quickSort` 應該是一個函數。 ```js assert(typeof quickSort == 'function'); ``` -`quickSort` should return a sorted array (least to greatest). +`quickSort` 應該返回一個排序的數組(從最小到最大)。 ```js assert( @@ -50,7 +50,7 @@ assert( ); ``` -`quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` should return an array that is unchanged except for order. +`quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` 應該返回一個數組,除了順序之外沒有變化。 ```js assert.sameMembers( @@ -77,7 +77,7 @@ assert.sameMembers( ); ``` -`quickSort` should not use the built-in `.sort()` method. +`quickSort` 不應使用內置的 `.sort()` 方法。 ```js assert(isBuiltInSortUsed()); diff --git a/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/inventory-update.md b/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/inventory-update.md index e21c765a5f..2d3f1e6db8 100644 --- a/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/inventory-update.md +++ b/curriculum/challenges/chinese-traditional/10-coding-interview-prep/algorithms/inventory-update.md @@ -1,6 +1,6 @@ --- id: a56138aff60341a09ed6c480 -title: Inventory Update +title: 庫存更新 challengeType: 5 forumTopicId: 16019 dashedName: inventory-update @@ -8,11 +8,11 @@ dashedName: inventory-update # --description-- -Compare and update the inventory stored in a 2D array against a second 2D array of a fresh delivery. Update the current existing inventory item quantities (in `arr1`). If an item cannot be found, add the new item and quantity into the inventory array. The returned inventory array should be in alphabetical order by item. +將存儲在二維數組中的庫存與新交貨的二維數組進行比較和更新。 更新當前現有庫存物料數量(在 `arr1`)。 如果找不到商品,請將新商品和數量添加到庫存數組中。 返回的庫存數組應按項目的字母順序排列。 # --hints-- -The function `updateInventory` should return an array. +函數 `updateInventory` 應該返回一個數組。 ```js assert.isArray( @@ -33,7 +33,7 @@ assert.isArray( ); ``` -`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return an array with a length of 6. +`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` 應該返回一個長度爲 6 的數組。 ```js assert.equal( @@ -55,7 +55,7 @@ assert.equal( ); ``` -`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return `[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]]`. +`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` 應返回`[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]]`。 ```js assert.deepEqual( @@ -84,7 +84,7 @@ assert.deepEqual( ); ``` -`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [])` should return `[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]]`. +`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [])`應該返回`[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]]`。 ```js assert.deepEqual( @@ -106,7 +106,7 @@ assert.deepEqual( ); ``` -`updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return `[[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]]`. +`updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` 應該返回 `[[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]]`。 ```js assert.deepEqual( @@ -128,7 +128,7 @@ assert.deepEqual( ); ``` -`updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]])` should return `[[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]]`. +`updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]])` 應返回 `[[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]]`。 ```js assert.deepEqual( diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/celestial-bodies-database.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/celestial-bodies-database.md index 3dd7c343d3..eb68e17a52 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/celestial-bodies-database.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/celestial-bodies-database.md @@ -1,6 +1,6 @@ --- id: 5f1a4ef5d5d6b5ab580fc6ae -title: Celestial Bodies Database +title: 天體數據庫 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.celestial-bodies-database diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md index ed95006792..cb0af0632a 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md @@ -1,6 +1,6 @@ --- id: 602da0de22201c65d2a019f6 -title: Learn Advanced Bash by Building a Kitty Ipsum Translator +title: 通過構建一個 Kitty Ipsum 翻譯器來學習高級 Bash challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-advanced-bash-by-building-a-kitty-ipsum-translator diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md index 76f6ff4eea..762c4bb354 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md @@ -1,6 +1,6 @@ --- id: 5f5b969a05380d2179fe6e18 -title: Learn Bash and SQL by Building a Bike Rental Shop +title: 通過構建自行車租賃店來學習 Bash 和 SQL challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-bash-and-sql-by-building-a-bike-rental-shop diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md index e1d2873609..f47b3b20fe 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md @@ -1,6 +1,6 @@ --- id: 5ea8adfab628f68d805bfc5e -title: Learn Bash by Building a Boilerplate +title: 通過構建模版學習 Bash challengeType: 12 helpCategory: Relational Databases url: https://github.com/freeCodeCamp/.learn-bash-by-building-a-boilerplate diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md index af55d50738..2c96bd1ca0 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md @@ -1,6 +1,6 @@ --- id: 5f5904ac738bc2fa9efecf5a -title: Learn Bash Scripting by Building Five Programs +title: 通過構建五個程序學習 Bash 腳本 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-bash-scripting-by-building-five-programs diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md index c2b735a923..974e40d8eb 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md @@ -1,6 +1,6 @@ --- id: 5fa323cdaf6a73463d590659 -title: Learn Git by Building an SQL Reference Object +title: 通過構建 SQL 引用對象來學習 Git challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-git-by-building-an-sql-reference-object diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md index f98a0b9293..22371edd33 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md @@ -1,6 +1,6 @@ --- id: 602da04222201c65d2a019f3 -title: Learn GitHub by Building a List of Inspirational Quotes +title: 通過建立勵志名言列表來學習 GitHub challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-github-by-building-a-list-of-inspirational-quotes diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md index b6f9e4ad71..24250ecfe3 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md @@ -1,6 +1,6 @@ --- id: 5f32db63eb37f7e17323f459 -title: Learn Nano by Building a Castle +title: 通過構建城堡來學習 Nano challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-nano-by-building-a-castle diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md index 189dcc68b7..1ffd5d9eab 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md @@ -1,6 +1,6 @@ --- id: 5f2c289f164c29556da632fd -title: Learn Relational Databases by Building a Mario Database +title: 通過構建 Mario 數據庫來學習關係型數據庫 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-relational-databases-by-building-a-mario-database diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md index 7b95cbca4b..c3dbeac87a 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md @@ -1,6 +1,6 @@ --- id: 602da0c222201c65d2a019f5 -title: Learn SQL by Building a Student Database +title: 通過構建學生數據庫學習 SQL challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-sql-by-building-a-student-database diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/number-guessing-game.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/number-guessing-game.md index eb354f91ae..e455407298 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/number-guessing-game.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/number-guessing-game.md @@ -1,6 +1,6 @@ --- id: 602da04c22201c65d2a019f4 -title: Number Guessing Game +title: 猜數字遊戲 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.number-guessing-game diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/periodic-table-database.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/periodic-table-database.md index 05c18517d1..af61272d03 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/periodic-table-database.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/periodic-table-database.md @@ -1,6 +1,6 @@ --- id: 602d9ff222201c65d2a019f2 -title: Periodic Table Database +title: 元素週期表數據庫 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.periodic-table-database diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md index 26fdda731e..7b7afb4cf5 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md @@ -1,6 +1,6 @@ --- id: 5f87ac112ae598023a42df1a -title: Salon Appointment Scheduler +title: 沙龍日程安排程序 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.salon-appointment-scheduler diff --git a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/world-cup-database.md b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/world-cup-database.md index 196a965de7..6b701996c9 100644 --- a/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/world-cup-database.md +++ b/curriculum/challenges/chinese-traditional/13-relational-databases/learn-relational-databases/world-cup-database.md @@ -1,6 +1,6 @@ --- id: 5f9771307d4d22b9d2b75a94 -title: World Cup Database +title: 世界盃數據庫 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.world-cup-database diff --git a/curriculum/challenges/chinese/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml b/curriculum/challenges/chinese/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml index 9270e8218d..00587c148a 100644 --- a/curriculum/challenges/chinese/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/back-end-development-and-apis-certification/back-end-development-and-apis-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17523bc -title: 后端开发和API证书 +title: 后端开发和 API 认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml b/curriculum/challenges/chinese/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml index 0cf05137bd..ca5d0fafca 100644 --- a/curriculum/challenges/chinese/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/data-analysis-with-python-certification/data-analysis-with-python-certification.yml @@ -1,6 +1,6 @@ --- id: 5e46fc95ac417301a38fb934 -title: Python 与数据分析证书 +title: Python 与数据分析认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/data-visualization-certification/data-visualization-certification.yml b/curriculum/challenges/chinese/00-certifications/data-visualization-certification/data-visualization-certification.yml index 3d096c7689..fd5c951d45 100644 --- a/curriculum/challenges/chinese/00-certifications/data-visualization-certification/data-visualization-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/data-visualization-certification/data-visualization-certification.yml @@ -1,6 +1,6 @@ --- id: 5a553ca864b52e1d8bceea14 -title: Data Visualization Certification +title: 数据可视化认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml b/curriculum/challenges/chinese/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml index 6dce4ecbeb..98c7107fe3 100644 --- a/curriculum/challenges/chinese/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/front-end-development-libraries-certification/front-end-development-libraries-certification.yml @@ -1,6 +1,6 @@ --- id: 561acd10cb82ac38a17513bc -title: 前端开发库证书 +title: 前端开发库认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/information-security-certification/information-security-certification.yml b/curriculum/challenges/chinese/00-certifications/information-security-certification/information-security-certification.yml index 0ef8142afe..acb0edb818 100644 --- a/curriculum/challenges/chinese/00-certifications/information-security-certification/information-security-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/information-security-certification/information-security-certification.yml @@ -1,6 +1,6 @@ --- id: 5e6021435ac9d0ecd8b94b00 -title: 信息安全证书 +title: 信息安全认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml b/curriculum/challenges/chinese/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml index a768927e29..960c3f4b8f 100644 --- a/curriculum/challenges/chinese/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/javascript-algorithms-and-data-structures-certification/javascript-algorithms-and-data-structures-certification.yml @@ -1,6 +1,6 @@ --- id: 561abd10cb81ac38a17513bc -title: JavaScript 算法和数据结构证书 +title: JavaScript 算法和数据结构认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml b/curriculum/challenges/chinese/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml index f6a784d09c..5f714ca65b 100644 --- a/curriculum/challenges/chinese/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/legacy-back-end-certification/legacy-back-end-certification.yml @@ -1,6 +1,6 @@ --- id: 660add10cb82ac38a17513be -title: 旧版后端证书 +title: 旧版后端认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml b/curriculum/challenges/chinese/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml index e9bb0f44c2..8bed0a2852 100644 --- a/curriculum/challenges/chinese/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/legacy-data-visualization-certification/legacy-data-visualization-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac39a17513bc -title: 旧版数据可视化证书 +title: 旧版数据可视化认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml b/curriculum/challenges/chinese/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml index de306ab596..28114e6687 100644 --- a/curriculum/challenges/chinese/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/legacy-front-end-certification/legacy-front-end-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17513be -title: 旧版前端证书 +title: 旧版前端认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml b/curriculum/challenges/chinese/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml index 1377a197cf..b54beb622b 100644 --- a/curriculum/challenges/chinese/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/legacy-full-stack-certification/legacy-full-stack-certification.yml @@ -6,19 +6,19 @@ isPrivate: true tests: - id: 561add10cb82ac38a17513bc - title: 响应式网页设计证书 + title: 响应式 Web 设计认证 - id: 561abd10cb81ac38a17513bc - title: JavaScript 算法和数据结构证书 + title: JavaScript 算法和数据结构认证 - id: 561acd10cb82ac38a17513bc - title: 前端库证书 + title: 前端库认证 - id: 5a553ca864b52e1d8bceea14 - title: 数据可视化证书 + title: 数据可视化认证 - id: 561add10cb82ac38a17523bc - title: API 和微服务证书 + title: API 和微服务认证 - id: 561add10cb82ac38a17213bc - title: 旧版信息安全和质量保证证书 + title: 旧版信息安全和质量保证认证 diff --git a/curriculum/challenges/chinese/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml b/curriculum/challenges/chinese/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml index f898d699ca..3ac3eeb9e8 100644 --- a/curriculum/challenges/chinese/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/legacy-information-security-and-quality-assurance-certification/legacy-information-security-and-quality-assurance-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17213bc -title: 旧版信息安全和质量保证证书 +title: 旧版信息安全和质量保证认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml b/curriculum/challenges/chinese/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml index 67fcd51025..0e1f6ced30 100644 --- a/curriculum/challenges/chinese/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/machine-learning-with-python-certification/machine-learning-with-python-certification.yml @@ -1,6 +1,6 @@ --- id: 5e46fc95ac417301a38fb935 -title: Machine Learning with Python Certification +title: Python 与机器学习认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/quality-assurance-certification/quality-assurance-certification.yml b/curriculum/challenges/chinese/00-certifications/quality-assurance-certification/quality-assurance-certification.yml index a414d2768d..6b1fc25795 100644 --- a/curriculum/challenges/chinese/00-certifications/quality-assurance-certification/quality-assurance-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/quality-assurance-certification/quality-assurance-certification.yml @@ -1,6 +1,6 @@ --- id: 5e611829481575a52dc59c0e -title: 质量保证证书 +title: 质量保证认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/relational-databases-certification/relational-databases-certification.yml b/curriculum/challenges/chinese/00-certifications/relational-databases-certification/relational-databases-certification.yml index 9a3c4df811..8000d6f106 100644 --- a/curriculum/challenges/chinese/00-certifications/relational-databases-certification/relational-databases-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/relational-databases-certification/relational-databases-certification.yml @@ -1,6 +1,6 @@ --- id: 606243f50267e718b1e755f4 -title: 关系型数据库证书 +title: 关系数据库认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml b/curriculum/challenges/chinese/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml index 8fc00be7be..e1cf90797d 100644 --- a/curriculum/challenges/chinese/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/responsive-web-design-certification/responsive-web-design-certification.yml @@ -1,6 +1,6 @@ --- id: 561add10cb82ac38a17513bc -title: 响应式网页设计认证项目 +title: 响应式 Web 设计认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml b/curriculum/challenges/chinese/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml index 7cf284f39f..a7ee92154c 100644 --- a/curriculum/challenges/chinese/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml +++ b/curriculum/challenges/chinese/00-certifications/scientific-computing-with-python-certification/scientific-computing-with-python-certification.yml @@ -1,6 +1,6 @@ --- id: 5e44431b903586ffb414c951 -title: Python 与科学计算证书 +title: Python 与科学计算认证 challengeType: 7 isPrivate: true tests: diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md index 356eee60c1..5a72f15781 100644 --- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md +++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.md @@ -10,7 +10,7 @@ dashedName: prevent-object-mutation 通过之前的挑战可以看出,`const` 声明并不会真的保护数据不被改变。 为了确保数据不被改变,JavaScript 提供了一个函数 `Object.freeze`。 -当一个对象被冻结的时候,你不能再对它的属性再进行增、删、改的操作。 任何试图改变对象的操作都会被阻止,却不会报错。 +任何更改对象的尝试都将被拒绝,如果脚本在严格模式下运行,将抛出错误。 ```js let obj = { @@ -23,7 +23,7 @@ obj.newProp = "Test"; console.log(obj); ``` -`obj.review` 和 `obj.newProp` 赋值将导致错误,控制台将显示值 `{ name: "FreeCodeCamp", review: "Awesome" }`。 +`obj.review` 和 `obj.newProp` 赋值将导致错误,因为我们的编辑器默认在严格模式下运行,控制台将显示值 `{ name: "FreeCodeCamp", review: "Awesome" }`。 # --instructions-- diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md index cddc7b5939..5f350cdf75 100644 --- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md +++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md @@ -38,7 +38,7 @@ JavaScript 的默认排序方法是 Unicode 值顺序排序,有时可能会得 # --instructions-- -在 `alphabeticalOrder` 函数中使用 `sort` 方法对 `arr` 中的元素按照字母顺序排列。 +在 `alphabeticalOrder` 函数中使用 `sort` 方法对 `arr` 中的元素按照字母顺序排列。 该函数应返回一个排序的数组。 # --hints-- @@ -83,7 +83,7 @@ assert( function alphabeticalOrder(arr) { // Only change code below this line - + return arr // Only change code above this line } alphabeticalOrder(["a", "d", "c", "a", "z", "g"]); diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md b/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md index d4f4e206dc..7e672070f0 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.md @@ -12,7 +12,7 @@ dashedName: add-font-awesome-icons-to-our-buttons # --description-- -Font Awesome 是一个非常便利的图标库。 我们可以通过 webfont 或矢量图的方式来使用这些图标。 这些图标就和字体一样, 不仅能通过像素单位指定它们的大小,它们也同样会继承父级 HTML 元素的字体大小。 +Font Awesome 是一个非常便利的图标库。 我们可以通过 webfont 或矢量图的方式来使用这些图标。 这些图标就和字体一样, 不仅能通过像素单位指定它们的大小,它们也同样会继承父级 HTML 元素的字号。 可以将 Font Awesome 图标库添加至任何一个 web app 中,方法很简单,只需要在 HTML head 标签中添加以下代码即可: diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md b/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md index adb60e7258..fab808050a 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/call-out-optional-actions-with-btn-info.md @@ -12,7 +12,7 @@ Bootstrap 有着丰富的预定义按钮颜色。 浅蓝色的 `btn-info` class 在 `Like` 按钮下方创建包含文本 `Info` 的块级 Bootstrap 按钮,然后为该按钮添加 Bootstrap 的 `btn-info` 和 `btn-block` classes。 -注意:这些按钮仍然需要 `btn` 和 `btn-block` classes。 +注意:这些按钮仍然需要 `btn` 和 `btn-block` class。 # --hints-- diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md b/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md index d056196aee..bc14a36cc5 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/bootstrap/create-a-bootstrap-button.md @@ -29,7 +29,7 @@ assert( assert($('button').hasClass('btn') && $('button').hasClass('btn-default')); ``` -保证所有 `button` 元素都有一个闭合标签。 +确保所有 `button` 元素都有闭合标签。 ```js assert( diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md index d699ebc7e2..433b232a2c 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md @@ -10,9 +10,9 @@ dashedName: build-a-25--5-clock **目标:** 在 [CodePen.io](https://codepen.io) 上实现一个功能类似 的 App。 -在满足以下[需求](https://en.wikipedia.org/wiki/User_story)并能通过所有测试的前提下, 可以根据自己的喜好来美化 app。 +在满足以下 [需求](https://en.wikipedia.org/wiki/User_story) 并能通过所有测试的前提下, 赋予它你自己的个人风格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战。 不推荐使用前面没有提到的技术,否则风险自负。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 如果使用建议的技术栈完成这个项目,我们会接受并尝试修复相关的问题反馈。 编码愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战;不推荐使用前面没有提到的技术,否则风险自负。 不推荐使用前面没有提到的技术,否则风险自担。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复你在使用推荐技术栈创建项目时报告的问题。 编码愉快! **需求 1:** 应该能看到一个具有`id="break-label"`属性的元素,这个元素的内容应该是一个字符串(例如:"Break Length")。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md index cab65e9c06..edded4482a 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md @@ -10,9 +10,9 @@ dashedName: build-a-drum-machine **目标:** 在 [CodePen.io](https://codepen.io) 上实现一个功能类似 的 App。 -在满足以下[需求](https://en.wikipedia.org/wiki/User_story)并能通过所有测试的前提下, 可以根据自己的喜好来美化 app。 +在满足以下 [需求](https://en.wikipedia.org/wiki/User_story) 并能通过所有测试的前提下, 赋予它你自己的个人风格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战。 不推荐使用前面没有提到的技术,否则风险自负。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复使用推荐技术栈遇到的反馈问题。 编码愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战。 不推荐使用前面没有提到的技术,否则风险自担。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复你在使用推荐技术栈创建项目时报告的问题。 编码愉快! **需求 1:** 应该可以看到一个具有 `id="drum-machine"` 属性的外层容器,该容器包含了其它所有元素。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md index 15a8faeaf4..8687ea7d70 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md @@ -10,9 +10,9 @@ dashedName: build-a-javascript-calculator **目标:** 在 [CodePen.io](https://codepen.io) 上实现一个功能类似 的 App。 -在满足以下[需求](https://en.wikipedia.org/wiki/User_story)并能通过所有测试的前提下, 可以根据自己的喜好来美化 app。 +在满足以下 [需求](https://en.wikipedia.org/wiki/User_story) 并能通过所有测试的前提下, 赋予它你自己的个人风格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战。 不推荐使用前面没有提到的技术,否则风险自负。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复使用推荐技术栈遇到的反馈问题。 编码愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战;不推荐使用前面没有提到的技术,否则风险自负。 不推荐使用前面没有提到的技术,否则风险自担。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复你在使用推荐技术栈创建项目时报告的问题。 编码愉快! **需求 1:** 计算器应该包含一个具有 `id="equals"` 属性的可以点击的元素,元素的文本内容为 `=`(等于符号)。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md index 1cbe3ea179..b86278c29e 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer.md @@ -10,9 +10,9 @@ dashedName: build-a-markdown-previewer **目标:** 在 [CodePen.io](https://codepen.io) 上实现一个功能类似 的 App。 -在满足以下[需求](https://en.wikipedia.org/wiki/User_story)并能通过所有测试的前提下, 你可以根据自己的喜好来美化 app。 +在满足以下 [需求](https://en.wikipedia.org/wiki/User_story) 并能通过所有测试的前提下, 赋予它你自己的个人风格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战。 不推荐使用前面没有提到的技术,否则风险自负。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复使用推荐技术栈遇到的反馈问题。 编码愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战;不推荐使用前面没有提到的技术,否则风险自负。 不推荐使用前面没有提到的技术,否则风险自担。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复你在使用推荐技术栈创建项目时报告的问题。 编码愉快! **需求 1:** 应该能看到一个具有 `id="editor"` 属性的 `textarea` 元素。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md index bda9fa92c2..76dea6de4c 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-random-quote-machine.md @@ -10,9 +10,9 @@ dashedName: build-a-random-quote-machine **目标:** 在 [CodePen.io](https://codepen.io) 上实现一个功能类似 的 App。 -在满足以下[需求](https://en.wikipedia.org/wiki/User_story)并能通过所有测试的前提下, 可以根据自己的喜好来美化 app。 +在满足以下 [需求](https://en.wikipedia.org/wiki/User_story) 并能通过所有测试的前提下, 赋予它你自己的个人风格。 -可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战。 不推荐使用前面没有提到的技术,否则风险自担。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复使用推荐技术栈遇到的反馈问题。 编码愉快! +可以使用 HTML、JavaScript、CSS、Bootstrap、SASS、React、Redux、jQuery 来完成这个挑战。 但鉴于这个章节的学习内容与前端框架相关,推荐使用一款前端框架(比如 React)来完成这个挑战;不推荐使用前面没有提到的技术,否则风险自负。 不推荐使用前面没有提到的技术,否则风险自担。 我们有计划新增其他前端框架课程,例如 Angular 和 Vue,不过目前还没有这些内容。 我们会接受并尝试修复你在使用推荐技术栈创建项目时报告的问题。 编码愉快! **需求 1:** 应该能看到一个具有 `id="quote-box"` 属性的包裹元素。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md b/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md index 8ff627bf03..b5ca026b97 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-even-elements-using-jquery.md @@ -39,7 +39,7 @@ assert( assert(code.match(/\:even/g)); ``` -应该仅用 jQuery 给元素添加 class。 +应该仅用 jQuery 给标签添加 class。 ```js assert( diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md b/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md index f45e7b26cc..e85e9504f0 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/jquery/target-html-elements-with-selectors-using-jquery.md @@ -33,7 +33,7 @@ $("button").addClass("animated bounce"); assert($('button').hasClass('animated') && $('button').hasClass('bounce')); ``` -应该仅用 jQuery 给元素添加 class。 +应该仅用 jQuery 给标签添加 class。 ```js assert(!code.match(/class.*animated/g)); diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md index 3ee3315453..ceb7579b57 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md @@ -18,7 +18,7 @@ dashedName: connect-redux-to-the-messages-app # --hints-- -`AppWrapper` 应渲染该页面上。 +`AppWrapper` 应该渲染该到页面上。 ```js assert( @@ -29,7 +29,7 @@ assert( ); ``` -`Presentational` 组件应该渲染到页面上。 +`Presentational` 应该渲染到页面上. ```js assert( @@ -70,7 +70,7 @@ assert( ); ``` -`Presentational` 组件应接收创建 action 的函数 `submitMessage` 属性。 +`Presentational` 组件应接收创建 action 的函数的 `submitMessage` 属性。 ```js assert( diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react/introducing-inline-styles.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react/introducing-inline-styles.md index debb3caa0f..3569b50079 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/react/introducing-inline-styles.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react/introducing-inline-styles.md @@ -31,7 +31,6 @@ JSX 元素使用 `style` 属性,但是鉴于 JSX 的编译方式,不能将 在代码编辑器中给 `div` 添加一个 `style` 属性,将文本颜色设置为红色,字体大小设置为 `72px`。 请注意,可以选择将字体大小设置为数字,省略单位 `px`,或者将其写为 `72px`。 - # --hints-- 组件应该渲染一个 `div` 元素。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-conditionally-from-props.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-conditionally-from-props.md index bcd87fcf88..99ad221e60 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-conditionally-from-props.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-conditionally-from-props.md @@ -8,7 +8,7 @@ dashedName: render-conditionally-from-props # --description-- -到目前为止,你已经看到如何使用 `if/else`、`&&` 以及三元运算符(`condition ? expressionIfTrue : expressionIfFalse`)在不同条件下运行不同的代码。 然而,还有一个重要的话题需要讨论,将这些概念中的任何一个或所有概念与另一个强大的 React 功能 props 结合起来。 使用 props 有条件地渲染代码在 React 开发人员中很常见——也就是说:他们使用给定 prop 的值来自动决定渲染什么。 +到目前为止,已经看到了如何使用 `if/else`、`&&`和三元运算符(`condition ? expressionIfTrue : expressionIfFalse`)对渲染什么和何时渲染做出有条件的判定。 然而,还有一个重要的话题需要讨论,将这些概念中的任何一个或所有概念与另一个强大的 React 功能 props 结合起来。 使用 props 有条件地渲染代码在 React 开发人员中很常见——也就是说:他们使用给定 prop 的值来自动决定渲染什么。 在这个挑战中,将设置一个子组件来根据 props 做出渲染决定。 可以使用三元运算符,但是可以看到过去几个挑战中涵盖的其他几个概念在这种情况下可能同样有用。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md index b378ef488b..18f1c408ff 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-html-elements-to-the-dom.md @@ -16,7 +16,7 @@ ReactDOM 提供了一个简单的方法来将 React 元素呈现给 DOM,如下 # --instructions-- -代码编辑器有一个简单的 JSX 组件。 使用 `ReactDOM.render()` 方法将该组件渲染到页面。 可以将定义好的 JSX 元素直接作为第一个参数传入,然后使用 `document.getElementById()` 来选择要渲染到的 DOM 节点, 在这个挑战中,请渲染到 `id='challenge-node'` 的 `div` 中。 确保没有修改 `JSX` 常量。 +代码编辑器有一个简单的 JSX 组件。 使用 `ReactDOM.render()` 方法将该组件渲染到页面。 可以将定义好的 JSX 元素直接作为第一个参数传入,然后使用 `document.getElementById()` 来选择要渲染到的 DOM 节点, 在这个挑战中,请渲染到 `id='challenge-node'`的 `div` 中。 确保没有修改 `JSX` 常量。 # --hints-- diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-with-an-if-else-condition.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-with-an-if-else-condition.md index 30054b865c..a20bed4d30 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-with-an-if-else-condition.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react/render-with-an-if-else-condition.md @@ -18,7 +18,7 @@ MyComponent 的 state 中包含一个 `boolean`(布尔值),用于跟踪是 # --hints-- -`MyComponent` 应该存在并被渲染。 +`MyComponent` 应该存在并渲染。 ```js assert( @@ -29,7 +29,7 @@ assert( ); ``` -当 `display` 被设置为 `true` 时,`div`、`button` 和 `h1` 标签应该被渲染。 +当 `display` 被设置为 `true` 时,`div`、`button` 和 `h1` 标签应该渲染。 ```js async () => { @@ -50,7 +50,7 @@ async () => { }; ``` -当 `display` 被设置为 `false` 时,只有 `div` 和 `button` 应该被渲染。 +当 `display` 被设置为 `false` 时,只有 `div` 和 `button` 应该渲染。 ```js async () => { diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md index 39c34ce5bd..f71bfe9e40 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react/use--for-a-more-concise-conditional.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036185 -title: Use && for a More Concise Conditional +title: 使用 && 获得更简洁的条件 challengeType: 6 forumTopicId: 301413 dashedName: use--for-a-more-concise-conditional @@ -8,7 +8,7 @@ dashedName: use--for-a-more-concise-conditional # --description-- -`if/else` 语句在上一次挑战中是有效的,但是有一种更简洁的方法可以达到同样的结果。 假设正在跟踪组件中的几个条件,并且希望根据这些条件中的每一个来渲染不同的元素。 如果你写了很多 `else if` 语句来返回稍微不同的 UI,你可能会写很多重复代码,这就留下了出错的空间。 相反,你可以使用 `&&` 逻辑运算符以更简洁的方式执行条件逻辑。 这是完全可行的,因为你希望检查条件是否为 `true`。如果是,则返回一些标记。 这里有一个例子: +`if/else` 语句在上一次挑战中是有效的,但是有一种更简洁的方法可以达到同样的结果。 假设正在跟踪组件中的几个条件,并且希望根据这些条件中的每一个来渲染不同的元素。 如果你写了很多 `else if` 语句来返回稍微不同的 UI,你可能会写很多重复代码,这就留下了出错的空间。 相反,你可以使用 `&&` 逻辑运算符以更简洁的方式执行条件逻辑。 这是完全可行的,因为你希望检查条件是否为 `true`。如果是,则返回一些标记。 下面是一个示例: ```jsx {condition &&

markup

} diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md index 3321f65741..94f255a099 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react/use-advanced-javascript-in-react-render-method.md @@ -8,7 +8,7 @@ dashedName: use-advanced-javascript-in-react-render-method # --description-- -在之前的挑战中,学习了如何使用大括号 `{ }` 将 JavaScript 代码插入到 JSX 代码中,用于访问 props、传递 props、访问 state、在代码中插入注释以及最近学习的定制组件样式等任务。 这些都是将 JavaScript 放在 JSX 中的常见用例,但是在 React 组件中使用 JavaScript 代码还有其他方式。 +在之前的挑战中,你学习了如何使用大括号 `{ }` 将 JavaScript 代码插入到 JSX 代码中,用于访问 props、传递 props、访问 state、在代码中插入注释以及最近学习的定制组件样式等任务。 这些都是将 JavaScript 放在 JSX 中的常见用例,但是在 React 组件中使用 JavaScript 代码还有其他方式。 在 `render` 方法中编写 JavaScript,可以把 JavaScript 直接放在 `return` 语句之前,而***不必***将其插入大括号中。 这是因为它还不在 JSX 代码中。 如果之后想在 `return` 语句中的 JSX 代码*里面*使用变量时,可以将变量名放在大括号中。 diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md b/curriculum/challenges/chinese/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md index 80a0900715..d60d7d393c 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/redux/copy-an-object-with-object.assign.md @@ -8,7 +8,7 @@ dashedName: copy-an-object-with-object-assign # --description-- -最后几个挑战适用于数组,但是当状态是 `object` 时,有一些方法可以实现状态不变性。 处理对象的一个常用的方法是 `Object.assign()`。 `Object.assign()` 获取目标对象和源对象,并将源对象中的属性映射到目标对象。 任何匹配的属性都会被源对象中的属性覆盖。 通常用于通过传递一个空对象作为第一个参数,然后是要用复制的对象来制作对象的浅表副本。 这是一个例子: +最后几个挑战适用于数组,但是当状态是 `object` 时,有一些方法可以实现状态不变性。 处理对象的一个常用的方法是 `Object.assign()`。 `Object.assign()` 获取目标对象和源对象,并将源对象中的属性映射到目标对象。 任何匹配的属性都会被源对象中的属性覆盖。 通常用于通过传递一个空对象作为第一个参数,然后是要用复制的对象来制作对象的浅表副本。 下面是一个示例: ```js const newObject = Object.assign({}, obj1, obj2); diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/redux/define-an-action-creator.md b/curriculum/challenges/chinese/03-front-end-development-libraries/redux/define-an-action-creator.md index 72d4501c33..fa807668d6 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/redux/define-an-action-creator.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/redux/define-an-action-creator.md @@ -8,7 +8,7 @@ dashedName: define-an-action-creator # --description-- -创建 action 后要将 action 发送到 Redux store,以便它可以更新其状态。 在 Redux 中,可以定义动作创建器来完成此任务, action creator 只是一个返回动作的 JavaScript 函数, 换句话说,action creator 创建表示动作事件的对象。 +创建 action 后要将 action 发送到 Redux store,以便它可以更新其状态。 在 Redux 中,可以定义动作创建器来完成此任务, action creator 只是一个返回动作的 JavaScript 函数。 换句话说,action creator 创建表示动作事件的对象。 # --instructions-- diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md b/curriculum/challenges/chinese/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md index 01199b43f6..16218e1cd0 100644 --- a/curriculum/challenges/chinese/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md +++ b/curriculum/challenges/chinese/03-front-end-development-libraries/sass/use-each-to-map-over-items-in-a-list.md @@ -16,7 +16,7 @@ dashedName: use-each-to-map-over-items-in-a-list } ``` -map 的语法略有不同。 这是一个例子: +map 的语法略有不同。 这是一个示例: ```scss $colors: (color1: blue, color2: red, color3: green); diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md index 822c272f87..3e496a3462 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md @@ -1,6 +1,6 @@ --- id: 5a8b073d06fa14fcfde687aa -title: Exercise 追踪器 +title: 运动追踪器 challengeType: 4 forumTopicId: 301505 dashedName: exercise-tracker @@ -8,13 +8,55 @@ dashedName: exercise-tracker # --description-- -构建一个 JavaScript 的全栈应用,在功能上与这个应用相似: 。 可以采用下面的一种方式完成这个挑战: +构建一个 JavaScript 的全栈应用,在功能上与这个应用相似: 。 在这个项目中,你将使用以下方法之一编写你的代码: - 克隆 [GitHub 仓库](https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/) 并在本地完成你的项目。 - 使用[我们的 Replit 初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-project-exercisetracker)来完成你的项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 + +# --instructions-- + +你的答案应该有以下结构。 + +运动: + +```js +{ + username: "fcc_test" + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + _id: "5fb5853f734231456ccb3b05" +} +``` + +用户: + +```js +{ + username: "fcc_test", + _id: "5fb5853f734231456ccb3b05" +} +``` + +日志: + +```js +{ + username: "fcc_test", + count: 1, + _id: "5fb5853f734231456ccb3b05", + log: [{ + description: "test", + duration: 60, + date: "Mon Jan 01 1990", + }] +} +``` + +**提示:** 对于 `date` 属性,`Date` API 的 `toDateString` 方法可以用于实现预期的输出。 # --hints-- @@ -29,7 +71,24 @@ dashedName: exercise-tracker }; ``` -可以将表单里的 `username` 通过 `POST` 请求发送到 `/api/users`,以创建一个新的用户。 返回的响应内容是一个带有 `username` 和 `_id` 的对象 +可以将表单里的 `username` 通过 `POST` 请求发送到 `/api/users`,以创建一个新的用户。 + +```js +async (getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +`POST /api/users` 带有表单数据 `username` 对请求,返回的响应将是一个具有 `username` 和 `_id` 属性的对象. ```js async (getUserInput) => { @@ -49,24 +108,89 @@ async (getUserInput) => { }; ``` -可以发送 `GET` 请求到 `/api/users`,以获取一个所有用户的数组, 数组里的每个元素都是一个包含 `username` 和 `_id` 的用户对象。 +你可以向 `/api/users` 发出 `GET` 请求以获取所有用户的列表。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + assert.isTrue(res.ok); + if(!res.ok) { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +对 `/api/users` 的 `GET` 请求返回一个数组。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + assert.isArray(users); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +从 `GET /api/users` 返回的数组中的每个元素都是一个对象字面量,包含用户的 `username` 和 `_id`。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users'); + if(res.ok){ + const users = await res.json(); + const user = users[0]; + assert.exists(user); + assert.exists(user.username); + assert.exists(user._id); + assert.isString(user.username); + assert.isString(user._id); + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +你能用表单里的 `description`、`duration` 和 `date`(可选)发送 `POST` 请求到 `/api/users/:_id/exercises`。 如果没有传入 date,默认采用当前日期。 ```js async (getUserInput) => { const url = getUserInput('url'); - const res = await fetch(url + '/api/users'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }); if (res.ok) { - const data = await res.json(); - assert.isArray(data); - assert.isString(data[0].username); - assert.isString(data[0]._id); + const { _id, username } = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: 'Mon Jan 01 1990' + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01` + }); + assert.isTrue(addRes.ok); + if(!addRes.ok) { + throw new Error(`${addRes.status} ${addRes.statusText}`) + }; } else { throw new Error(`${res.status} ${res.statusText}`); } }; ``` -你能用表单里的 `description`、`duration` 和 `date`(可选)发送 `POST` 请求到 `/api/users/:_id/exercises`。 如果没有传入 date,默认采用当前日期。 响应内容是包含 exercise 表单内容的 user 对象。 +从 `POST /api/users/:_id/exercises` 返回的响应将是添加了运动字段的用户对象。 ```js async (getUserInput) => { @@ -93,6 +217,9 @@ async (getUserInput) => { if (addRes.ok) { const actual = await addRes.json(); assert.deepEqual(actual, expected); + assert.isString(actual.description); + assert.isNumber(actual.duration); + assert.isString(actual.date); } else { throw new Error(`${addRes.status} ${addRes.statusText}`); } @@ -102,7 +229,7 @@ async (getUserInput) => { }; ``` -可以发送 `GET` 请求到 `/api/users/:_id/logs`,以获取任何用户的完整 exercise 日志。 响应内容是一个 user 对象,它带有一个 `log` 属性,该属性的值是所有被添加的 exercises 表单记录组成的数组, 每一个 log 数组里的元素应该是一个含有 `description`、`duration` 和 `date` 等属性的对象。 +可以发送 `GET` 请求到 `/api/users/:_id/logs`,以获取任何用户的完整 exercise 日志。 ```js async (getUserInput) => { @@ -128,13 +255,10 @@ async (getUserInput) => { }); if (addRes.ok) { const logRes = await fetch(url + `/api/users/${_id}/logs`); - if (logRes.ok) { - const { log } = await logRes.json(); - assert.isArray(log); - assert.equal(1, log.length); - } else { - throw new Error(`${logRes.status} ${logRes.statusText}`); - } + assert.isTrue(logRes.ok); + if(!logRes.ok) { + throw new Error(`${logRes.status} ${logRes.statusText}`) + }; } else { throw new Error(`${addRes.status} ${addRes.statusText}`); } @@ -144,7 +268,7 @@ async (getUserInput) => { }; ``` -用户日志请求(`/api/users/:_id/logs`)返回一个带有 `count` 属性的对象,该属性反映 exercises 表单的成功提交次数(译者注:即 log 属性元素的个数)。 +对用户日志的请求 `GET /api/users/:_id/logs` 返回一个用户对象,该对象具有一个 `count` 属性,表示属于该用户的运动次数。 ```js async (getUserInput) => { @@ -185,7 +309,239 @@ async (getUserInput) => { }; ``` -可以把 `from`、`to` 和 `limit` 参数添加到一个 `/api/users/:_id/logs` 请求,以查询该用户的部分 exercise 表单提交记录, `from` 和 `to` 是 `yyyy-mm-dd` 形式的日期, `limit` 是希望返回的 log 数量。 +对 `/api/users/:id/logs` 的 `GET` 请求将返回用户对象,其中包含添加的所有练习的 `log` 数组。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }) + if(res.ok){ + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok){ + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + assert.isArray(log); + assert.equal(1, log.length); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +从 `GET /api/users/:id/logs` 返回的 `log` 数组中的每一项都是一个应该具有 `description` 的对象, `duration` 和 `date` 属性。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + `/api/users`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `username=fcc_test_${Date.now()}`.substr(0, 29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok) { + const {log} = await logRes.json(); + const exercise = log[0]; + assert.exists(exercise); + assert.exists(exercise.description); + assert.exists(exercise.duration); + assert.exists(exercise.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + }; + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`) + }; +}; +``` + +从 `GET /api/users/:id/logs` 返回的 `log` 数组中任何对象的 `description` 属性都应该是一个字符串。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users/', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substr(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.description); + assert.equal(exercise.description, expected.description); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +从 `GET /api/users/:id/logs` 返回的 `log` 数组中任何对象的 `duration` 属性都应该是一个数字。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users/', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substr(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isNumber(exercise.duration); + assert.equal(exercise.duration, expected.duration); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +从 `GET /api/users/:id/logs` 返回的 `log` 数组中任何对象的 `date` 属性应该是一个字符串。 使用 `Date` API 的 `dateString` 格式。 + +```js +async(getUserInput) => { + const url = getUserInput('url'); + const res = await fetch(url + '/api/users/', { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `username=fcc_test_${Date.now()}`.substr(0,29) + }); + if(res.ok) { + const {_id, username} = await res.json(); + const expected = { + username, + description: 'test', + duration: 60, + _id, + date: new Date().toDateString() + }; + const addRes = await fetch(url + `/api/users/${_id}/exercises`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `description=${expected.description}&duration=${expected.duration}` + }); + if(addRes.ok) { + const logRes = await fetch(url + `/api/users/${_id}/logs`); + if(logRes.ok){ + const {log} = await logRes.json(); + const exercise = log[0]; + assert.isString(exercise.date); + assert.equal(exercise.date, expected.date); + } else { + throw new Error(`${logRes.status} ${logRes.statusText}`); + } + } else { + throw new Error(`${addRes.status} ${addRes.statusText}`); + }; + } else { + throw new Error(`${res.status} ${res.statusText}`); + }; +}; +``` + +你可以将 `from`、`to` 和 `limit` 参数添加到 `GET /api/users/:_id/logs` 请求检索任何用户的部分日志。 `from` 和 `to` 是 `yyyy-mm-dd` 形式的日期, `limit` 是希望返回的 log 数量。 ```js async (getUserInput) => { diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md index cbcefdf512..4f7d2f5f9e 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice.md @@ -8,13 +8,13 @@ dashedName: file-metadata-microservice # --description-- -构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 可以采用下面的一种方式完成这个挑战: +构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 在这个项目中,你将使用以下方法之一编写你的代码: - 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) 并在本地完成项目。 - 使用[我们的 Replit 初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-project-filemetadata)来完成你的项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 # --instructions-- diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md index c45835d2e6..19b218543f 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice.md @@ -8,13 +8,13 @@ dashedName: request-header-parser-microservice # --description-- -构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 可以采用下面的一种方式完成这个挑战: +构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 在这个项目中,你将使用以下方法之一编写你的代码: - 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-headerparser/) 并在本地完成项目。 - 使用[我们的 Replit 初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-project-headerparser)来完成你的项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 # --hints-- diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md index 3be780c090..638ebd0430 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md @@ -8,13 +8,13 @@ dashedName: timestamp-microservice # --description-- -构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 可以采用下面的任意一种方式完成这个挑战: +构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 在这个项目中,你将使用以下方法之一编写你的代码: -- 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-timestamp/) 并在本地完成项目。 +- 克隆 [这个 GitHub 仓库](https://github.com/freeCodeCamp/boilerplate-project-timestamp/) 并在本地完成项目。 - 使用[我们的 Replit 初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-project-timestamp)来完成你的项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 # --hints-- diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md index d8ef2d7f14..0e6c78b124 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md @@ -8,13 +8,13 @@ dashedName: url-shortener-microservice # --description-- -构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 可以采用下面的任意一种方式完成这个挑战: +构建一个 JavaScript 的全栈应用,在功能上与这个应用相似:。 在这个项目中,你将使用以下方法之一编写你的代码: - 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) 并在本地完成项目。 - 使用[我们的 Replit 初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-project-urlshortener)来完成你的项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 # --instructions-- diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md index 9990fcc19e..b6f3aa5769 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/get-data-from-post-requests.md @@ -18,11 +18,11 @@ dashedName: get-data-from-post-requests POST(有时候是 PUT)- 使用请求发送信息,以创建新资源; -GET- 读取不用修改的已存在的资源; +GET - 读取不用修改的已存在的资源; PUT 或者 PATCH(有时候是 POST)- 发送数据,以更新资源; -DELETE=> 删除一个资源。 +DELETE => 删除一个资源。 还有其他两种方法常用于与服务进行交互。 除了 GET 之外,上面列出的所有方法都可以负载数据(即数据都能放到消息正文中), 这些方法也可以使用 body-parser 中间件。 diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md index c7252097a4..2be53272d8 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/implement-a-root-level-request-logger-middleware.md @@ -10,7 +10,7 @@ dashedName: implement-a-root-level-request-logger-middleware 前面我们介绍了 `express.static()` 中间件函数, 现在是时候更详细地了解什么是中间件了。 中间件函数是一个接收 3 个参数的函数,这 3 个参数分别是:请求对象、响应对象和在应用的请求-响应循环中的下一个函数。 中间件函数执行一些可能对应用程序产生一些效果的代码,通常还会在请求对象或者响应对象里添加一些信息, 它们也可以在满足某些条件时通过发送响应来结束循环, 如果在它们完成时没有发送响应,那么就会开始执行堆栈中的下一个函数, `next()` 将触发调用第 3 个参数。 -看看下面的例子: +请看以下示例: ```js function(req, res, next) { @@ -25,7 +25,7 @@ function(req, res, next) { 构建一个简单的日志记录器。 对于每个请求,它应该在控制台中打印一个采用以下格式的字符串:`method path - ip`, 例如:`GET /json - ::ffff:127.0.0.1`。 注意 `method` 和 `path` 之间有一个空格,并且 `path` 和 `ip` 中间的破折号的两边都有空格。 可以使用 `req.method`、`req.path` 和 `req.ip` 从请求对象中分别获取请求方法(http 动词)、路由相对路径和请求者的 ip 信息。 当你完成时,记得要调用 `next()`,否则服务器将一直处于挂起状态。 请确保“Logs”是打开的,观察一下当一些请求到达时会发生什么事情。 -**注意:**Express 按照函数在代码中出现的顺序来执行, 中间件也是如此。 如果你想让中间件函数适用于所有路由,那么应该在路由之前配置好中间件。 +**注意:** Express 按照函数在代码中出现的顺序来执行, 中间件也是如此。 如果你想让中间件函数适用于所有路由,那么应该在路由之前配置好中间件。 # --hints-- diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md index 5313f4f122..3df24be7e7 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/basic-node-and-express/meet-the-node-console.md @@ -8,13 +8,13 @@ dashedName: meet-the-node-console # --description-- -可以采用下面的任意一种方式完成这些挑战: +你可以采用下面的任意一种编写代码的方式来完成这些挑战: - 克隆 [这个 GitHub 仓库](https://github.com/freeCodeCamp/boilerplate-express/) 并在本地完成项目。 - 使用[我们的 Repl.it 上的初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-express)来完成项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 在开发过程中,能够随时看到代码的运行结果是非常重要的。 diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md index 750ac57eb1..960812294f 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-version-to-your-package.json.md @@ -8,7 +8,7 @@ dashedName: add-a-version-to-your-package-json # --description-- -`version` 是 package.json 文件中必填字段之一, 这个字段描述了当前项目的版本, 如: +`version` 是 package.json 文件中必填字段之一, 这个字段描述了当前项目的版本, 下面是一个示例: ```json "version": "1.2.0", diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md index bc063888ad..9e694d4650 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-keywords-to-your-package.json.md @@ -8,7 +8,7 @@ dashedName: add-keywords-to-your-package-json # --description-- -在 `keywords` 字段中可以使用相关的关键字描述项目。 例如: +在 `keywords` 字段中可以使用相关的关键字描述项目。 下面是一个示例: ```json "keywords": [ "descriptive", "related", "words" ], diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md index 88a34d83c7..2735584f31 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm.md @@ -28,7 +28,7 @@ dashedName: expand-your-project-with-external-packages-from-npm # --hints-- -“dependencies”应该包含“moment” +“dependencies”字段应该包含“moment” ```js (getUserInput) => diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md index e7d5bf0f1b..742b48b4bd 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md @@ -8,13 +8,13 @@ dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-packa # --description-- -可以采用下面的任意一种方式完成这些挑战: +你可以采用下面的任意一种编写代码的方式来完成这些挑战: - 克隆 [GitHub repo](https://github.com/freeCodeCamp/boilerplate-npm/) 并在本地完成项目。 - 使用[我们的 Replit 上的初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-npm)来完成项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 此外,还可以将项目的源码提交到 `GitHub Link` 中。 `package.json` 文件是所有 Node.js 项目和 npm 包的枢纽, 和 HTML 文档中的 <head> 区域用来描述网页的配置信息(元数据)一样,它存储项目的相关信息。 它由单个 JSON 对象组成,并以键值对的形式存储项目信息, 且至少包含两个必填字段:“name”和“version”——但是最好提供有关项目的其他信息,这将对用户或者维护者有所帮助。 diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md index 9765a58914..3e8a212605 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-caret-character-to-use-the-latest-minor-version-of-a-dependency.md @@ -22,7 +22,7 @@ dashedName: use-the-caret-character-to-use-the-latest-minor-version-of-a-depende 在依赖项中,使用脱字符(`^`)为 moment 的版本添加前缀,允许 npm 更新依赖包到任意新的次版本。 -**注意:**原来的版本号不用更改。 +**注意:** 原来的版本号不用更改。 # --hints-- diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md index 953bceb910..a3d11ce3f9 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/use-the-tilde-character-to-always-use-the-latest-patch-version-of-a-dependency.md @@ -26,7 +26,7 @@ dashedName: use-the-tilde-character-to-always-use-the-latest-patch-version-of-a- # --hints-- -“dependencies”应该包含“moment” +“dependencies”字段中应包含“moment” ```js (getUserInput) => diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md index ff103b6f6c..87921bac6b 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/create-a-model.md @@ -8,7 +8,7 @@ dashedName: create-a-model # --description-- -**C**RUD 第一小节——CREATE +**C** RUD 第一小节——CREATE 首先,我们需要一个 Schema, 每一个 Schema 都对应一个 MongoDB 的 collection, 并且在相应的 collection 里定义 documents 的“样子”。 Schema 用于组成模型(Model), 我们甚至可以通过嵌套 Schema 来创建复杂的模型。目前我们先从简。 我们可以根据模型创建实例,模型实例化后的对象称为 documents。 diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md index aaa58840e7..b34455e8c2 100644 --- a/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md +++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/mongodb-and-mongoose/install-and-set-up-mongoose.md @@ -8,13 +8,13 @@ dashedName: install-and-set-up-mongoose # --description-- -可以采用下面的任意一种方式完成这些挑战: +你可以采用下面的任意一种编写代码的方式来完成这些挑战: -- 克隆 [GitHub repo](https://github.com/freeCodeCamp/boilerplate-mongomongoose/) 并在本地完成项目。 +- 克隆 [这个 GitHub 仓库](https://github.com/freeCodeCamp/boilerplate-mongomongoose/) 并在本地完成项目。 - 使用[我们的 Replit 上的初始化项目](https://replit.com/github/freeCodeCamp/boilerplate-mongomongoose)来完成项目。 -- 使用你选择的网站生成器来完成项目, 并确保包含了我们 GitHub 仓库的所有文件。 +- 使用你选择的网站生成器来完成项目。 需要包含我们 GitHub 仓库的所有文件。 -当完成本项目,请确认有一个正常运行的 demo 可以公开访问。 然后将 URL 提交到 `Solution Link` 中。 +完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 字段中提交它的 URL。 在这个挑战中,你将建立一个 MongoDB Atlas 数据库并导入连接到它所需的软件包。 @@ -22,7 +22,7 @@ dashedName: install-and-set-up-mongoose # --instructions-- -将 `mongodb` 和 `mongoose` 添加到项目的 `package.json` 文件中。 然后,在 `myApp.js` 文件中请求 `mongoose`。 创建一个 `.env` 文件,给它添加一个 `MONGO_URI` 变量。 变量的值为你的 MongoDB Atlas 数据库 URI。 应用单引号或双引号包裹 URI。请记住,环境变量 `=` 两边不能有空格。 例如,`MONGO_URI='VALUE'`。 完成后,使用下面的代码来连接数据库。 +将 `mongodb@~3.6.0` 和 `mongoose@~5.4.0` 添加到项目的 `package.json` 中。 然后,在 `myApp.js` 文件中请求 `mongoose`。 创建一个 `.env` 文件,给它添加一个 `MONGO_URI` 变量。 变量的值为你的 MongoDB Atlas 数据库 URI。 应用单引号或双引号包裹 URI。请记住,环境变量 `=` 两边不能有空格。 例如,`MONGO_URI='VALUE'`。 完成后,使用下面的代码来连接数据库。 ```js mongoose.connect(, { useNewUrlParser: true, useUnifiedTopology: true }); diff --git a/curriculum/challenges/chinese/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md b/curriculum/challenges/chinese/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md index 6ef68b014f..5bab04aa82 100644 --- a/curriculum/challenges/chinese/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md +++ b/curriculum/challenges/chinese/08-data-analysis-with-python/data-analysis-with-python-course/parsing-html-and-saving-data.md @@ -19,7 +19,7 @@ dashedName: parsing-html-and-saving-data ## --text-- -为了解析 HTML 文本和提取表格,`.read_html()` 位于哪个 Python 的库? +哪个 Python 库有 `.read_html()` 方法,我们可以用于解析 HTML 文档和提取表格? ## --answers-- diff --git a/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/implement-quick-sort.md b/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/implement-quick-sort.md index 53ac770885..7744d0c7a3 100644 --- a/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/implement-quick-sort.md +++ b/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/implement-quick-sort.md @@ -1,6 +1,6 @@ --- id: 587d825a367417b2b2512c89 -title: Implement Quick Sort +title: 实现快速排序 challengeType: 1 forumTopicId: 301615 dashedName: implement-quick-sort @@ -8,21 +8,21 @@ dashedName: implement-quick-sort # --description-- -Here we will move on to an intermediate sorting algorithm: quick sort. Quick sort is an efficient, recursive divide-and-conquer approach to sorting an array. In this method, a pivot value is chosen in the original array. The array is then partitioned into two subarrays of values less than and greater than the pivot value. We then combine the result of recursively calling the quick sort algorithm on both sub-arrays. This continues until the base case of an empty or single-item array is reached, which we return. The unwinding of the recursive calls return us the sorted array. +在这里,我们将继续讨论中间排序算法:快速排序。 快速排序是对数组进行排序的一种有效的,递归的分而治之的方法。 在此方法中,在原始数组中选择一个枢轴值。 然后将该数组分成两个小于和大于数值的子数组。 然后,我们在两个子阵列上结合递归调用快速排序算法的结果。 这一直持续到达到空或单项数组的基本情况,我们返回。 递归调用的展开将返回已排序的数组。 -Quick sort is a very efficient sorting method, providing *O(nlog(n))* performance on average. It is also relatively easy to implement. These attributes make it a popular and useful sorting method. +快速排序是一种非常有效的排序方法,平均提供 *O(nlog(n))* 的性能。 它也相对容易实现。 这些属性使其成为一种流行且有用的排序方法。 -**Instructions:** Write a function `quickSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. While the choice of the pivot value is important, any pivot will do for our purposes here. For simplicity, the first or last element could be used. +**说明:** 编写一个函数 `quickSort`,它将整数数组作为输入,并按从最小到最大的排序顺序返回这些整数的数组。 虽然枢轴值的选择很重要,但任何枢轴都可以满足我们的目的。 为简单起见,可以使用第一个或最后一个元素。 # --hints-- -`quickSort` should be a function. +`quickSort` 应该是一个函数。 ```js assert(typeof quickSort == 'function'); ``` -`quickSort` should return a sorted array (least to greatest). +`quickSort` 应该返回一个排序的数组(从最小到最大)。 ```js assert( @@ -50,7 +50,7 @@ assert( ); ``` -`quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` should return an array that is unchanged except for order. +`quickSort([1,4,2,8,345,123,43,32,5643,63,123,43,2,55,1,234,92])` 应该返回一个数组,除了顺序之外没有变化。 ```js assert.sameMembers( @@ -77,7 +77,7 @@ assert.sameMembers( ); ``` -`quickSort` should not use the built-in `.sort()` method. +`quickSort` 不应使用内置的 `.sort()` 方法。 ```js assert(isBuiltInSortUsed()); diff --git a/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/inventory-update.md b/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/inventory-update.md index e21c765a5f..43a5d63f82 100644 --- a/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/inventory-update.md +++ b/curriculum/challenges/chinese/10-coding-interview-prep/algorithms/inventory-update.md @@ -1,6 +1,6 @@ --- id: a56138aff60341a09ed6c480 -title: Inventory Update +title: 库存更新 challengeType: 5 forumTopicId: 16019 dashedName: inventory-update @@ -8,11 +8,11 @@ dashedName: inventory-update # --description-- -Compare and update the inventory stored in a 2D array against a second 2D array of a fresh delivery. Update the current existing inventory item quantities (in `arr1`). If an item cannot be found, add the new item and quantity into the inventory array. The returned inventory array should be in alphabetical order by item. +将存储在二维数组中的库存与新交货的二维数组进行比较和更新。 更新当前现有库存物料数量(在 `arr1`)。 如果找不到商品,请将新商品和数量添加到库存数组中。 返回的库存数组应按项目的字母顺序排列。 # --hints-- -The function `updateInventory` should return an array. +函数 `updateInventory` 应该返回一个数组。 ```js assert.isArray( @@ -33,7 +33,7 @@ assert.isArray( ); ``` -`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return an array with a length of 6. +`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` 应该返回一个长度为 6 的数组。 ```js assert.equal( @@ -55,7 +55,7 @@ assert.equal( ); ``` -`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return `[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]]`. +`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` 应返回`[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]]`。 ```js assert.deepEqual( @@ -84,7 +84,7 @@ assert.deepEqual( ); ``` -`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [])` should return `[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]]`. +`updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [])`应该返回`[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]]`。 ```js assert.deepEqual( @@ -106,7 +106,7 @@ assert.deepEqual( ); ``` -`updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` should return `[[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]]`. +`updateInventory([], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]])` 应该返回 `[[67, "Bowling Ball"], [2, "Hair Pin"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]]`。 ```js assert.deepEqual( @@ -128,7 +128,7 @@ assert.deepEqual( ); ``` -`updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]])` should return `[[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]]`. +`updateInventory([[0, "Bowling Ball"], [0, "Dirty Sock"], [0, "Hair Pin"], [0, "Microphone"]], [[1, "Hair Pin"], [1, "Half-Eaten Apple"], [1, "Bowling Ball"], [1, "Toothpaste"]])` 应返回 `[[1, "Bowling Ball"], [0, "Dirty Sock"], [1, "Hair Pin"], [1, "Half-Eaten Apple"], [0, "Microphone"], [1, "Toothpaste"]]`。 ```js assert.deepEqual( diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/celestial-bodies-database.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/celestial-bodies-database.md index 3dd7c343d3..07143cf0af 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/celestial-bodies-database.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/celestial-bodies-database.md @@ -1,6 +1,6 @@ --- id: 5f1a4ef5d5d6b5ab580fc6ae -title: Celestial Bodies Database +title: 天体数据库 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.celestial-bodies-database diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md index ed95006792..ad5be270be 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-advanced-bash-by-building-a-kitty-ipsum-translator.md @@ -1,6 +1,6 @@ --- id: 602da0de22201c65d2a019f6 -title: Learn Advanced Bash by Building a Kitty Ipsum Translator +title: 通过构建一个 Kitty Ipsum 翻译器来学习高级 Bash challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-advanced-bash-by-building-a-kitty-ipsum-translator diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md index 76f6ff4eea..6b1c0bcdf7 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-and-sql-by-building-a-bike-rental-shop.md @@ -1,6 +1,6 @@ --- id: 5f5b969a05380d2179fe6e18 -title: Learn Bash and SQL by Building a Bike Rental Shop +title: 通过构建自行车租赁店来学习 Bash 和 SQL challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-bash-and-sql-by-building-a-bike-rental-shop diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md index e1d2873609..36c8a77658 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-by-building-a-boilerplate.md @@ -1,6 +1,6 @@ --- id: 5ea8adfab628f68d805bfc5e -title: Learn Bash by Building a Boilerplate +title: 通过构建模版学习 Bash challengeType: 12 helpCategory: Relational Databases url: https://github.com/freeCodeCamp/.learn-bash-by-building-a-boilerplate diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md index af55d50738..e4502e6b40 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-bash-scripting-by-building-five-programs.md @@ -1,6 +1,6 @@ --- id: 5f5904ac738bc2fa9efecf5a -title: Learn Bash Scripting by Building Five Programs +title: 通过构建五个程序学习 Bash 脚本 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-bash-scripting-by-building-five-programs diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md index c2b735a923..b34dd8da07 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-git-by-building-an-sql-reference-object.md @@ -1,6 +1,6 @@ --- id: 5fa323cdaf6a73463d590659 -title: Learn Git by Building an SQL Reference Object +title: 通过构建 SQL 引用对象来学习 Git challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-git-by-building-an-sql-reference-object diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md index f98a0b9293..06a9495bc4 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-github-by-building-a-list-of-inspirational-quotes.md @@ -1,6 +1,6 @@ --- id: 602da04222201c65d2a019f3 -title: Learn GitHub by Building a List of Inspirational Quotes +title: 通过建立励志名言列表来学习 GitHub challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-github-by-building-a-list-of-inspirational-quotes diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md index b6f9e4ad71..9ecb8453d0 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-nano-by-building-a-castle.md @@ -1,6 +1,6 @@ --- id: 5f32db63eb37f7e17323f459 -title: Learn Nano by Building a Castle +title: 通过构建城堡来学习 Nano challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-nano-by-building-a-castle diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md index 189dcc68b7..094a223393 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-relational-databases-by-building-a-mario-database.md @@ -1,6 +1,6 @@ --- id: 5f2c289f164c29556da632fd -title: Learn Relational Databases by Building a Mario Database +title: 通过构建 Mario 数据库来学习关系型数据库 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-relational-databases-by-building-a-mario-database diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md index 7b95cbca4b..48572f1467 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/learn-sql-by-building-a-student-database.md @@ -1,6 +1,6 @@ --- id: 602da0c222201c65d2a019f5 -title: Learn SQL by Building a Student Database +title: 通过构建学生数据库学习 SQL challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.learn-sql-by-building-a-student-database diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/number-guessing-game.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/number-guessing-game.md index eb354f91ae..7525ab4669 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/number-guessing-game.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/number-guessing-game.md @@ -1,6 +1,6 @@ --- id: 602da04c22201c65d2a019f4 -title: Number Guessing Game +title: 猜数字游戏 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.number-guessing-game diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/periodic-table-database.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/periodic-table-database.md index 05c18517d1..87d2cd931b 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/periodic-table-database.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/periodic-table-database.md @@ -1,6 +1,6 @@ --- id: 602d9ff222201c65d2a019f2 -title: Periodic Table Database +title: 元素周期表数据库 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.periodic-table-database diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md index 26fdda731e..710610f520 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/salon-appointment-scheduler.md @@ -1,6 +1,6 @@ --- id: 5f87ac112ae598023a42df1a -title: Salon Appointment Scheduler +title: 沙龙日程安排程序 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.salon-appointment-scheduler diff --git a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/world-cup-database.md b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/world-cup-database.md index 196a965de7..e52b0e8366 100644 --- a/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/world-cup-database.md +++ b/curriculum/challenges/chinese/13-relational-databases/learn-relational-databases/world-cup-database.md @@ -1,6 +1,6 @@ --- id: 5f9771307d4d22b9d2b75a94 -title: World Cup Database +title: 世界杯数据库 challengeType: 12 helpCategory: Relational Databases url: https://github.com/moT01/.world-cup-database diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md index 9c4cd57087..f3cc6a163c 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md @@ -38,7 +38,7 @@ Por defecto, JavaScript ordena basándose en el valor "Unicode" de la cadena de # --instructions-- -Utiliza el método `sort` en la función `alphabeticalOrder` para ordenar los elementos de `arr` en orden alfabético. +Utiliza el método `sort` en la función `alphabeticalOrder` para ordenar los elementos de `arr` en orden alfabético. La función debe devolver el arreglo ordenado. # --hints-- @@ -83,7 +83,7 @@ assert( function alphabeticalOrder(arr) { // Only change code below this line - + return arr // Only change code above this line } alphabeticalOrder(["a", "d", "c", "a", "z", "g"]); diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/give-sibling-elements-a-unique-key-attribute.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/give-sibling-elements-a-unique-key-attribute.md index ed710f6552..c30be6297f 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/give-sibling-elements-a-unique-key-attribute.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/give-sibling-elements-a-unique-key-attribute.md @@ -10,11 +10,11 @@ dashedName: give-sibling-elements-a-unique-key-attribute El último desafío mostró cómo el método `map` es usado para representar dinámicamente un número de elementos según la entrada del usuario. Sin embargo, faltaba una pieza importante de ese ejemplo. Cuando creas un arreglo de elementos, cada uno necesita un atributo `key` establecido en un valor único. React usa estas claves para realizar un seguimiento de los elementos que se agregan, cambian o eliminan. Esto ayuda a que el proceso de re-renderización sea más eficiente cuando la lista se modifica de alguna manera. -**Nota:** Las claves solo necesitan ser únicas entre elementos hermanos, no es necesario que sean únicas globalmente en tu aplicación. +**Nota:** Las claves solo necesitan ser únicas entre elementos hermanos, no es necesario que sean globalmente únicas en tu aplicación. # --instructions-- -El editor de código tiene un arreglo con algunos frameworks frontend y un componente funcional sin estado llamado `Frameworks()`. `Frameworks()` necesita mapear el arreglo a una lista desordenada, como en el último desafío. Finaliza la escritura del callback `map` para devolver un elemento `li` por cada framework en el arreglo `frontEndFrameworks`. Esta vez, debes asegurarte de dar a cada elemento `li` un atributo `key`, establecido a un valor único. Los elementos `li` también deben contener texto de `frontEndFrameworks`. +El editor de código tiene un arreglo con algunos frameworks frontend y un componente funcional sin estado llamado `Frameworks()`. `Frameworks()` necesita mapear (asignar) el arreglo a una lista desordenada, como en el último desafío. Finaliza la escritura del callback `map` para devolver un elemento `li` por cada framework en el arreglo `frontEndFrameworks`. Esta vez, debes asegurarte de dar a cada elemento `li` un atributo `key`, establecido a un valor único. Los elementos `li` también deben contener texto de `frontEndFrameworks`. Normalmente, deseas hacer que la clave sea algo que identifique de manera única el elemento que se está procesando. Como último recurso se puede utilizar el índice del arreglo, pero normalmente se debe intentar usar una identificación única. diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/introducing-inline-styles.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/introducing-inline-styles.md index 829a540d68..a3bf96e7aa 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/introducing-inline-styles.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/introducing-inline-styles.md @@ -31,7 +31,6 @@ Los elementos JSX usan el atributo `style`, pero debido a la forma en que JSX es Agrega un atributo `style` al `div` en el editor de código para darle al texto un color rojo y un tamaño de fuente de `72px`. Ten en cuenta que puedes establecer opcionalmente el tamaño de la fuente para que sea un número, omitiendo las unidades `px`, o escribirlo como `72px`. - # --hints-- El componente debe renderizar un elemento `div`. diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/learn-about-self-closing-jsx-tags.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/learn-about-self-closing-jsx-tags.md index a2248db9f5..bbe93b3b94 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/learn-about-self-closing-jsx-tags.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/learn-about-self-closing-jsx-tags.md @@ -14,7 +14,7 @@ Otra forma importante en la que JSX difiere de HTML está en la idea de la etiqu En HTML, casi todas las etiquetas tienen una etiqueta de apertura y cierre: `
`; la etiqueta de cierre siempre tiene una barra inclinada antes del nombre de la etiqueta que está cerrando. Sin embargo, hay instancias especiales en HTML llamadas “etiquetas auto-cerradas”, o etiquetas que no requieren una etiqueta de apertura y cierre antes de que otra etiqueta pueda comenzar. -Por ejemplo, la etiqueta salto de línea puede escribirse como `
` o como `
`, pero nunca debería escribirse como `

`, ya que no contiene ningún contenido. +Por ejemplo, la etiqueta de salto de línea puede escribirse como `
` o como `
`, pero nunca debe escribirse como `

`, ya que no contiene ningún contenido. En JSX, las reglas son un poco diferentes. Cualquier elemento JSX se puede escribir con una etiqueta de auto-cierre, y cada elemento debe ser cerrado. La etiqueta de salto de línea, por ejemplo, siempre debe escribirse como `
` para ser un JSX válido que puede ser transpilado. Por otra parte, un `
` puede escribirse como `
` o `
`. La diferencia es que en la primera versión de sintaxis no hay forma de incluir nada en la `
`. Verás en desafíos posteriores que esta sintaxis es útil al renderizar componentes de React. diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md index cee7be441a..b5dcf4e1ca 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md @@ -8,13 +8,13 @@ dashedName: optimize-re-renders-with-shouldcomponentupdate # --description-- -Hasta ahora, si cualquier componente recibe un nuevo `state` o un nuevo `props`, se vuelve a renderizar a sí mismo y a todos sus hijos. Normalmente, esto está bien. Pero React proporciona un método de ciclo de vida al que puedes llamar cuando los componentes hijos reciben nuevos `state` o `props`, y declarar específicamente si los componentes deben actualizarse o no. El método es `shouldComponentUpdate()`y toma `nextProps` y `nextState` como parámetros. +Hasta ahora, si cualquier componente recibe un nuevo `state` o un nuevo `props`, se vuelve a renderizar a sí mismo y a todos sus hijos. Normalmente, esto está bien. Pero React proporciona un método de ciclo de vida al que puedes llamar cuando los componentes hijos reciben nuevos `state` o `props`, y declarar específicamente si los componentes deben actualizarse o no. El método es `shouldComponentUpdate()`, y toma `nextProps` y `nextState` como parámetros. Este método es una forma útil de optimizar el rendimiento. Por ejemplo, el comportamiento predeterminado es que el componente re-renderiza cuando recibe nuevos `props`, incluso si los `props` no han cambiado. Puedes usar `shouldComponentUpdate()` para evitar esto comparando los `props`. El método debe devolver un valor `boolean` que le diga a React si actualizar o no el componente. Puedes comparar los "props" actuales (`this.props`) a los siguientes "props" (`nextProps`) para determinar si necesita actualizar o no, y devuelve `true` o `false` en consecuencia. # --instructions-- -El método `shouldComponentUpdate()` se añade en un componente llamado `OnlyEvens`. Actualmente, este método devuelve `true`, así que `OnlyEvens` re-renderizar cada vez que recibe nuevos `props`. Modifica el método para que `OnlyEvens` se actualice sólo si el `value` de sus nuevos accesorios es par. Haz clic en el botón `Add` y observa el orden de los eventos en la consola de tu navegador mientras se activan los "hooks" del ciclo de vida. +El método `shouldComponentUpdate()` se añade en un componente llamado `OnlyEvens`. Actualmente, este método devuelve `true`, así que `OnlyEvens` re-renderiza cada vez que recibe nuevos `props`. Modifica el método para que `OnlyEvens` se actualice sólo si el `value` de sus nuevos "props" es par. Haz clic en el botón `Add` y observa el orden de los eventos en la consola de tu navegador mientras se activan los "hooks" del ciclo de vida. # --hints-- diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-a-callback-as-props.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-a-callback-as-props.md index ad6fa1a6c5..12ae7abae6 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-a-callback-as-props.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-a-callback-as-props.md @@ -14,7 +14,7 @@ Puedes pasar `state` como "props" a los componentes hijos, pero no estás limita Hay tres componentes descritos en el editor de código. El componente `MyApp` es el padre que renderizará los componentes hijos `GetInput` y `RenderInput`. Añade el componente `GetInput` al método de renderizar en `MyApp`, luego pásale un "prop" llamado `input` asignado a `inputValue` desde el estado `state` de `MyApp`. También crea un "prop" llamado `handleChange` y pasa el controlador de entrada `handleChange` a este. -A continuación, añade `RenderInput` al método de renderizar en `MyApp`, luego crea un "prop" llamado `input` y pasa él `inputValue` desde el estado `state` a este. Una vez que hayas terminado podrás escribir en el campo `input` en el componente `GetInput`, que luego llama al método manejador en su padre a través de "props". Esto actualiza la entrada en el `state` del padre, que se pasa como "props" a ambos hijos. Observa cómo fluyen los datos entre los componentes y cómo la única fuente de verdad sigue siendo el `state` del componente padre. Es cierto que este ejemplo es un poco inventado, pero debe servir para ilustrar cómo los datos y los callbacks pueden ser pasados entre componentes React. +A continuación, añade `RenderInput` al método de renderizar en `MyApp`, luego crea un "prop" llamado `input` y pasa el `inputValue` desde el estado `state` a este. Una vez que hayas terminado podrás escribir en el campo `input` en el componente `GetInput`, que luego llama al método manejador en su padre a través de "props". Esto actualiza la entrada en el `state` del padre, que se pasa como "props" a ambos hijos. Observa cómo fluyen los datos entre los componentes y cómo la única fuente de verdad sigue siendo el `state` del componente padre. Es cierto que este ejemplo es un poco inventado, pero debe servir para ilustrar cómo los datos y los callbacks pueden ser pasados entre componentes React. # --hints-- @@ -51,7 +51,7 @@ assert( ); ``` -El componente `GetInput` debe recibir la propiedad de estado `MyApp` `inputValue` como "props" y contener un elemento `input` que modifica el estado de `MyApp`. +El componente `GetInput` debe recibir la propiedad de estado `inputValue` de `MyApp` como "props" y contener un elemento `input` que modifica el estado de `MyApp`. ```js async () => { @@ -74,7 +74,7 @@ async () => { }; ``` -El componente `RenderInput` debe recibir la propiedad de estado `MyApp` `inputValue` como "props". +El componente `RenderInput` debe recibir la propiedad de estado `inputValue` de `MyApp` como "props". ```js async () => { diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-an-array-as-props.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-an-array-as-props.md index 8ed35cbc29..2b72d1c970 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-an-array-as-props.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-an-array-as-props.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403616a -title: Pasa un arreglo como props +title: Pasa un arreglo como "props" challengeType: 6 forumTopicId: 301401 dashedName: pass-an-array-as-props diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-props-to-a-stateless-functional-component.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-props-to-a-stateless-functional-component.md index 70045f451d..0ced1453df 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-props-to-a-stateless-functional-component.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-props-to-a-stateless-functional-component.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036169 -title: Pasa props a un componente funcional sin estado +title: Pasa "props" a un componente funcional sin estado challengeType: 6 forumTopicId: 301402 dashedName: pass-props-to-a-stateless-functional-component @@ -30,7 +30,7 @@ Hay componentes `Calendar` y `CurrentDate` en el editor de código. Al prensenta # --hints-- -El componente `Calendar` debe retornar un único elemento `div`. +El componente `Calendar` debe devolver un único elemento `div`. ```js assert( diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-state-as-props-to-child-components.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-state-as-props-to-child-components.md index 232f60a1b8..965c4cb903 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-state-as-props-to-child-components.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/pass-state-as-props-to-child-components.md @@ -8,7 +8,7 @@ dashedName: pass-state-as-props-to-child-components # --description-- -Has visto varios ejemplos de como pasar props a elementos JSX hijos y a componentes React hijos en desafíos anteriores. Te preguntarás de dónde vienen esos props. Un patrón común es tener un componente con estado que contenga el `state` importante para tu aplicación, que luego renderiza los componentes hijos. Quieres que estos componentes tengan acceso a algunas partes de ese `state`, el cual se pasa como props. +Has visto varios ejemplos que pasaban props a elementos JSX hijos y a componentes React hijos en desafíos anteriores. Te preguntarás de dónde vienen esos props. Un patrón común es tener un componente con estado que contenga el `state` importante para tu aplicación, que luego renderiza los componentes hijos. Quieres que estos componentes tengan acceso a algunas partes de ese `state`, el cual se pasa como props. Por ejemplo, tal vez tengas un componente `App` que renderiza una `Navbar`, entre otros componentes. En tu `App`, tienes un `state` que contiene mucha información del usuario, pero la `Navbar` sólo necesita acceder al nombre de usuario para poder mostrarlo. Pasas esa parte del `state` al componente `Navbar` como prop. diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-react-on-the-server-with-rendertostring.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-react-on-the-server-with-rendertostring.md index f0d9b797b3..2b07d7a645 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-react-on-the-server-with-rendertostring.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-react-on-the-server-with-rendertostring.md @@ -8,7 +8,7 @@ dashedName: render-react-on-the-server-with-rendertostring # --description-- -Hasta ahora, has estado renderizando componentes React en el cliente. Normalmente, esto es lo que siempre harás. Sin embargo, hay algunos casos de uso donde tiene sentido renderizar un componente React en el servidor. Dado que React es una biblioteca de vistas de JavaScript y se puede ejecutar JavaScript en el servidor con Node, esto es posible. De hecho, React proporciona un método `renderToString()` que puedes usar para este propósito. +Hasta ahora, has estado renderizando componentes React en el cliente. Normalmente, esto es lo que siempre harás. Sin embargo, hay algunos casos de uso donde tiene sentido renderizar un componente React en el servidor. Dado que React es una librería de vistas de JavaScript y se puede ejecutar JavaScript en el servidor con Node, esto es posible. De hecho, React proporciona un método `renderToString()` que puedes usar para este propósito. Hay dos razones clave por las que el renderizado en el servidor puede ser usado en una aplicación del mundo real. Primero, sin hacer esto, tus aplicaciones de React consistirían en un archivo HTML relativamente vacío y un gran paquete de JavaScript cuando se carga inicialmente en el navegador. Esto puede no ser ideal para motores de búsqueda que intentan indexar el contenido de tus páginas para que la gente pueda encontrarte. Si renderizas el código HTML inicial en el servidor y lo envía al cliente, la carga de la página inicial contiene todo el código de la página que los motores de búsqueda pueden rastrear. Segundo, esto crea una experiencia de carga de página inicial más rápida porque el HTML renderizado es más pequeño que el código JavaScript de toda la aplicación. React aún podrá reconocer tu aplicación y administrarla después de la carga inicial. diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface-another-way.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface-another-way.md index 21f59401e8..f8b45bb0c3 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface-another-way.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface-another-way.md @@ -12,7 +12,7 @@ Hay otra manera de acceder al `state` de un componente. En el método `render()` # --instructions-- -En el método de renderización de `MyComponent`, define una `const` llamada `name` y ponlo igual al valor del nombre en el `state` del componente. Debido a que puedes escribir JavaScript directamente en esta parte del código, no tienes que incluir esta referencia entre llaves. +En el método de renderización de `MyComponent`, define una `const` llamada `name` y asígnalo igual al valor del nombre en el `state` del componente. Debido a que puedes escribir JavaScript directamente en esta parte del código, no tienes que incluir esta referencia entre llaves. A continuación, en la sentencia return, renderiza este valor en una etiqueta `h1` usando la variable `name`. Recuerda, necesitas usar la sintaxis JSX (llaves para JavaScript) en la sentencia return. diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface.md index ccdfe0afd8..77d757e80c 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-state-in-the-user-interface.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036171 -title: Renderizar estado en la interfaz de usuario +title: Renderiza el estado en la interfaz de usuario challengeType: 6 forumTopicId: 301409 dashedName: render-state-in-the-user-interface @@ -12,7 +12,7 @@ Una vez que se define el estado inicial de un componente, se puede mostrar cualq Si quieres acceder a un valor de estado dentro del `return` del método de renderización, tienes que encerrar el valor entre llaves. -`state` es una de las características más poderosas de los componentes de React. Esto te permite realizar un seguimiento de los datos importantes en tu aplicación y generar una interfaz de usuario en respuesta a los cambios en estos datos. Si tus datos cambian, tu interfaz de usuario cambiará. React usa lo que se llama un DOM virtual, para realizar un seguimiento de los cambios detrás de escena. Cuando se actualizan los datos de estado, activa un re-renderizado de los componentes usando esos datos - incluyendo componentes hijos que recibieron los datos como un prop. React actualiza el DOM actual, pero solo cuando sea necesario. Esto significa que no tienes que preocuparte por cambiar el DOM. Tú simplemente declara cómo debe verse la UI. +`state` es una de las características más poderosas de los componentes de React. Esto te permite realizar un seguimiento de los datos importantes en tu aplicación y generar una interfaz de usuario en respuesta a los cambios en estos datos. Si tus datos cambian, tu interfaz de usuario cambiará. React usa lo que se llama un DOM virtual, para realizar un seguimiento de los cambios detrás de escena. Cuando se actualizan los datos de estado, activa un re-renderizado de los componentes usando esos datos: incluyendo componentes hijos que recibieron los datos como un prop. React actualiza el DOM actual, pero solo cuando sea necesario. Esto significa que no tienes que preocuparte por cambiar el DOM. Tú simplemente declara cómo debe verse la interfaz de usuario. Ten en cuenta que si creas un componente con estado, ningún otro componente es consciente de su `state`. Su `state` está completamente encapsulado, o local a ese componente, a menos que pases datos de estado a un componente hijo como `props`. Esta noción de `state` encapsulado, es muy importante porque te permite escribir cierta lógica, luego tener esa lógica contenida y aislada en un lugar de tu código. @@ -20,7 +20,7 @@ Ten en cuenta que si creas un componente con estado, ningún otro componente es En el editor de código, `MyComponent` ya tiene estado. Define una etiqueta `h1` en el método de renderizado del componente que renderiza el valor del `name` desde el estado del componente. -**Note:** El `h1` solo debe renderizar el valor de `state` y nada más. En JSX, cualquier código que escribas con llaves `{ }` será tratado como JavaScript. Así que para acceder al valor desde él `state` solo hay que encerrar la referencia entre llaves. +**Note:** El `h1` solo debe renderizar el valor de `state` y nada más. En JSX, cualquier código que escribas con llaves `{ }` será tratado como JavaScript. Así que para acceder al valor desde el `state` solo hay que encerrar la referencia entre llaves. # --hints-- diff --git a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-with-an-if-else-condition.md b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-with-an-if-else-condition.md index 9f140b27d5..fe5db3876b 100644 --- a/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-with-an-if-else-condition.md +++ b/curriculum/challenges/espanol/03-front-end-development-libraries/react/render-with-an-if-else-condition.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036184 -title: Renderizar con una condición If-Else +title: Renderiza con una condición If-Else challengeType: 6 forumTopicId: 301410 dashedName: render-with-an-if-else-condition @@ -8,11 +8,11 @@ dashedName: render-with-an-if-else-condition # --description-- -Otra aplicación de uso de JavaScript para controlar su vista renderizada es vincular los elementos que son renderizados a una condición. Cuando la condición es verdadera (true), se renderiza una vista. Cuando es falso (false), es una vista diferente. Puedes hacer esto con una sentencia estándar `if/else` en el método `render()` de un componente React. +Otra aplicación del uso de JavaScript para controlar la vista renderizada es vincular los elementos que se renderizan a una condición. Cuando la condición es verdadera (true), se renderiza una vista. Cuando es falso (false), es una vista diferente. Puedes hacer esto con una sentencia estándar `if/else` en el método `render()` de un componente React. # --instructions-- -MyComponent contiene un `boolean` en su estado que rastrea si deseas mostrar algún elemento en la interfaz de usuario o no. Él `button` alterna el estado de este valor. Actualmente, renderiza la misma UI cada vez. Reescribir el método `render()` con una sentencia `if/else` de modo que si `display` es `true`, devuelvas el marcado actual. De lo contrario, devuelve el marcado sin el elemento `h1`. +MyComponent contiene un `boolean` en su estado que rastrea si deseas mostrar algún elemento en la interfaz de usuario o no. El `button` alterna el estado de este valor. Actualmente, renderiza la misma interfaz de usuario cada vez. Reescribir el método `render()` con una sentencia `if/else` de modo que si `display` es `true`, devuelvas el marcado actual. De lo contrario, devuelve el marcado sin el elemento `h1`. **Note:** Debes escribir un `if/else` para pasar las pruebas. El uso del operador ternario no pasará aquí. @@ -29,7 +29,7 @@ assert( ); ``` -Cuando `display` se establece en `true`, un `div`, `button`, y `h1` deben renderizarse. +Cuando `display` se establece en `true`, un `div`, `button`, y `h1` debe renderizarse. ```js async () => { @@ -50,7 +50,7 @@ async () => { }; ``` -Cuando `display` se establece en `false`, solo un `div` y un `button` deben renderizarse. +Cuando `display` se establece en `false`, solo un `div` y un `button` debe renderizarse. ```js async () => { diff --git a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md b/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md index d1e27b1e9b..6e733a5bcb 100644 --- a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md +++ b/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.md @@ -38,7 +38,7 @@ O método de ordenação padrão do JavaScript é por valores de ponto Unicode, # --instructions-- -Use o método `sort` na função `alphabeticalOrder` para ordenar os elementos de `arr` em ordem alfabética. +Use o método `sort` na função `alphabeticalOrder` para ordenar os elementos de `arr` em ordem alfabética. A função deve retornar o array ordenado. # --hints-- @@ -83,7 +83,7 @@ assert( function alphabeticalOrder(arr) { // Only change code below this line - + return arr // Only change code above this line } alphabeticalOrder(["a", "d", "c", "a", "z", "g"]); diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.md index ff404ac1ed..aef2f20a94 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-116-red-green-or-blue-tiles.md @@ -1,6 +1,6 @@ --- id: 5900f3e01000cf542c50fef3 -title: 'Problema 116: Azulejos vermelhos, verdes ou azuis' +title: 'Problema 116: Blocos vermelhos, verdes ou azuis' challengeType: 5 forumTopicId: 301742 dashedName: problem-116-red-green-or-blue-tiles @@ -8,21 +8,21 @@ dashedName: problem-116-red-green-or-blue-tiles # --description-- -Uma fileira de cinco azulejos quadrados pretos deve ser substituída por azulejos oblongos coloridos, escolhidos entre vermelho (comprimento dois), verde (comprimento três), ou azul (comprimento quatro). +Uma fileira de cinco blocos quadrados pretos deve ser substituída por blocos oblongos coloridos, escolhidos entre vermelhos (comprimento dois), verdes (comprimento três) ou azuis (comprimento quatro). -Se forem escolhidos os azulejos vermelhos, haverá exatamente sete maneiras de fazer isso. +Se forem escolhidos os blocos vermelhos, haverá exatamente sete maneiras de fazer isso. -Formas possíveis de colocar um oblongo vermelho em uma linha com comprimento de cinco unidades +Formas possíveis de colocar um oblongo vermelho em uma linha com cinco unidades de comprimento Se escolhermos os blocos verdes, há três maneiras de fazer isso. -Formas possíveis de colocar um oblongo verde em uma linha com comprimento de cinco unidades +Formas possíveis de colocar um oblongo verde em uma linha com cinco unidades de comprimento E se os blocos azuis forem escolhidos, há duas maneiras de fazer isso. -Formas possíveis de colocar um oblongo azul em uma linha com comprimento de cinco unidades +Formas possíveis de colocar um oblongo azul em uma linha com cinco unidades de comprimento -Assumindo que as cores não podem ser misturadas, há 7 + 3 + 2 = 12 maneiras de substituir os blocos pretos em sequência, medindo cinco unidades de comprimento. De quantas maneiras diferentes os azulejos pretos em uma fileira medindo cinquenta unidades de comprimento podem ser substituídos, se as cores não podem ser misturadas e pelo menos um azulejo colorido deve ser usado? +Assumindo que as cores não podem ser misturadas, há 7 + 3 + 2 = 12 maneiras de substituir os blocos pretos em sequência, medindo cinco unidades de comprimento. De quantas maneiras diferentes os blocos pretos em uma fileira medindo cinquenta unidades de comprimento podem ser substituídos, se as cores não podem ser misturadas e pelo menos um bloco colorido deve ser usado? **Observação:** este problema está relacionado ao Problema 117. diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.md index ed6d035559..9eb8612647 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-117-red-green-and-blue-tiles.md @@ -1,6 +1,6 @@ --- id: 5900f3e21000cf542c50fef4 -title: 'Problem 117: Red, green, and blue tiles' +title: 'Problema 117: Azulejos vermelhos, verdes e azuis' challengeType: 5 forumTopicId: 301743 dashedName: problem-117-red-green-and-blue-tiles @@ -8,17 +8,17 @@ dashedName: problem-117-red-green-and-blue-tiles # --description-- -Using a combination of black square tiles and oblong tiles chosen from: red tiles measuring two units, green tiles measuring three units, and blue tiles measuring four units, it is possible to tile a row measuring five units in length in exactly fifteen different ways. +Usando uma combinação de blocos quadrados pretos e blocos oblongos selecionados entre: blocos vermelhos medindo duas unidades, blocos verdes medindo três unidades e blocos azuis medindo quatro unidades, é possível fazer fileiras de cinco unidades de comprimento exatamente de quinze formas diferentes. -Possible ways of placing red, green and blue oblongs on a row with length of five units +Formas possíveis de colocar oblongos vermelhos, verdes e azuis em uma linha com cinco unidades de comprimento -How many ways can a row measuring fifty units in length be tiled? +De quantas maneiras uma fileira de cinquenta unidades de comprimento pode ser preenchida? -**Note**: This is related to Problem 116. +**Observação**: este problema está relacionado ao Problema 116. # --hints-- -`redGreenBlueTilesTwo()` should return `100808458960497`. +`redGreenBlueTilesTwo()` deve retornar `100808458960497`. ```js assert.strictEqual(redGreenBlueTilesTwo(), 100808458960497); diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.md index 00a0605319..ce626e6875 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-118-pandigital-prime-sets.md @@ -1,6 +1,6 @@ --- id: 5900f3e21000cf542c50fef5 -title: 'Problem 118: Pandigital prime sets' +title: 'Problema 118: Conjuntos de números primos pandigitais' challengeType: 5 forumTopicId: 301744 dashedName: problem-118-pandigital-prime-sets @@ -8,13 +8,13 @@ dashedName: problem-118-pandigital-prime-sets # --description-- -Using all of the digits 1 through 9 and concatenating them freely to form decimal integers, different sets can be formed. Interestingly with the set $\\{2, 5, 47, 89, 631\\}$, all of the elements belonging to it are prime. +Usando todos os dígitos de 1 a 9 e concatenando-os livremente para formar números inteiros decimais, diferentes conjuntos podem ser formados. É interessante que, com o conjunto $\\{2, 5, 47, 89, 631\\}$, todos os elementos pertencentes a ele são primos. -How many distinct sets containing each of the digits one through nine exactly once contain only prime elements? +Quantos conjuntos distintos, contendo cada um dos algarismos de um a nove exatamente uma vez, são compostos apenas por elementos primos? # --hints-- -`pandigitalPrimeSets()` should return `44680`. +`pandigitalPrimeSets()` deve retornar `44680`. ```js assert.strictEqual(pandigitalPrimeSets(), 44680); diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-119-digit-power-sum.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-119-digit-power-sum.md index 72ed8397d7..b44512a177 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-119-digit-power-sum.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-119-digit-power-sum.md @@ -1,6 +1,6 @@ --- id: 5900f3e41000cf542c50fef6 -title: 'Problem 119: Digit power sum' +title: 'Problema 119: Soma das potências dos dígitos' challengeType: 5 forumTopicId: 301745 dashedName: problem-119-digit-power-sum @@ -8,17 +8,17 @@ dashedName: problem-119-digit-power-sum # --description-- -The number 512 is interesting because it is equal to the sum of its digits raised to some power: $5 + 1 + 2 = 8$, and $8^3 = 512$. Another example of a number with this property is $614656 = 28^4$. +O número 512 é interessante porque é igual à soma de seus algarismos elevado a alguma potência: $5 + 1 + 2 = 8$, e $8^3 = 512$. Outro exemplo de um número com essa propriedade é $614656 = 28^4$. -We shall define an to be the $n-th$ term of this sequence and insist that a number must contain at least two digits to have a sum. +Vamos definir um número para ser o $n-ésimo$ termo desta sequência e reforçar que um número deve conter pelo menos dois dígitos para ter uma soma. -You are given that $a_2 = 512$ and $a_{10} = 614656$. +Você já sabe que $a_2 = 512$ e $a_{10} = 614656$. -Find $a_{30}$. +Encontre $a_{30}$. # --hints-- -`digitPowerSum()` should return `248155780267521`. +`digitPowerSum()` deve retornar `248155780267521`. ```js assert.strictEqual(digitPowerSum(), 248155780267521); diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-120-square-remainders.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-120-square-remainders.md index 828f12b906..8fea47b356 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-120-square-remainders.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-120-square-remainders.md @@ -1,6 +1,6 @@ --- id: 5900f3e41000cf542c50fef7 -title: 'Problem 120: Square remainders' +title: 'Problema 120: Restos quadrados' challengeType: 5 forumTopicId: 301747 dashedName: problem-120-square-remainders @@ -8,15 +8,15 @@ dashedName: problem-120-square-remainders # --description-- -Let `r` be the remainder when ${(a − 1)}^n + {(a + 1)}^n$ is divided by $a^2$. +Considere que `r` seja o resto quando ${(a -- 1)}^n + {(a + 1)}^n$ é dividido por $a^2$. -For example, if $a = 7$ and $n = 3$, then $r = 42: 6^3 + 8^3 = 728 ≡ 42 \\ \text{mod}\\ 49$. And as `n` varies, so too will `r`, but for $a = 7$ it turns out that $r_{max} = 42$. +Por exemplo, se $a = 7$ e $n = 3$, então $r = 42: 6^3 + 8^3 = 728 ≡ 42 \\ \text{mod}\\ 49$. Conforme `n` varia, `r` também vai variar, mas, para $a = 7$, temos que $r_{max} = 42$. -For $3 ≤ a ≤ 1000$, find $\sum{r}_{max}$. +Para $3 ≤ a ≤ 1000$, encontre $\sum{r}_{max}$. # --hints-- -`squareRemainders()` should return `333082500`. +`squareRemainders()` deve retornar `333082500`. ```js assert.strictEqual(squareRemainders(), 333082500); diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.md index 1cc716c41c..6911136a42 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-121-disc-game-prize-fund.md @@ -1,6 +1,6 @@ --- id: 5900f3e51000cf542c50fef8 -title: 'Problem 121: Disc game prize fund' +title: 'Problema 121: Fundo de prêmio de jogo do disco' challengeType: 5 forumTopicId: 301748 dashedName: problem-121-disc-game-prize-fund @@ -8,20 +8,20 @@ dashedName: problem-121-disc-game-prize-fund # --description-- -A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its colour is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random. +Uma bolsa contém um disco vermelho e um disco azul. Em um jogo de azar, um jogador recebe um disco aleatório e sua cor é anotada. Após cada turno, o disco é devolvido à sacola, um disco vermelho extra é adicionado e outro disco é retirado aleatoriamente. -The player pays £1 to play and wins if they have taken more blue discs than red discs at the end of the game. +O jogador paga £1 para jogar e ganha se tiver recebido mais discos azuis do que discos vermelhos no final do jogo. -If the game is played for four turns, the probability of a player winning is exactly 11/120, and so the maximum prize fund the banker should allocate for winning in this game would be £10 before they would expect to incur a loss. Note that any payout will be a whole number of pounds and also includes the original £1 paid to play the game, so in the example given the player actually wins £9. +Se o jogo for jogado por quatro turnos, a probabilidade de um jogador vencer é exatamente 11/120, e, portanto, o fundo de prêmio máximo que a banca deve atribuir para a vitória neste jogo seria de 10 libras esterlinas antes de esperar sofrer uma perda. Observe que qualquer pagamento será um número inteiro de libras e que ele também incluirá a quantia de £1 original paga para jogar o jogo. Portanto, no exemplo dado, o jogador, ganha de fato 9 libras. -Find the maximum prize fund that should be allocated to a single game in which fifteen turns are played. +Encontre o fundo máximo de prêmios que deve ser atribuído a um único jogo em que se jogam quinze turnos. # --hints-- -`euler121()` should return 2269. +`discGamePrize()` deve retornar `2269`. ```js -assert.strictEqual(euler121(), 2269); +assert.strictEqual(discGamePrize(), 2269); ``` # --seed-- @@ -29,12 +29,12 @@ assert.strictEqual(euler121(), 2269); ## --seed-contents-- ```js -function euler121() { +function discGamePrize() { return true; } -euler121(); +discGamePrize(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.md index a20c0a95ea..5ccd7af8e3 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-75-singular-integer-right-triangles.md @@ -1,6 +1,6 @@ --- id: 5900f3b71000cf542c50feca -title: 'Problem 75: Singular integer right triangles' +title: 'Problema 75: Triângulos retângulos de lados inteiros e singulares' challengeType: 5 forumTopicId: 302188 dashedName: problem-75-singular-integer-right-triangles @@ -8,7 +8,7 @@ dashedName: problem-75-singular-integer-right-triangles # --description-- -It turns out that 12 cm is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are many more examples. +12 cm parece ser o menor comprimento de linha que pode ser determinado para formar um triângulo com ângulo reto inteiro exatamente de uma maneira, mas há muitos outros exemplos.
12 cm: (3,4,5)
@@ -19,41 +19,41 @@ It turns out that 12 cm is the smallest length of wire that can be bent to form 48 cm: (12,16,20)

-In contrast, some lengths of wire, like 20 cm, cannot be bent to form an integer sided right angle triangle, and other lengths allow more than one solution to be found; for example, using 120 cm it is possible to form exactly three different integer sided right angle triangles. +Por outro lado, alguns comprimentos de linha, como 20 cm, não podem ser dobrados de modo a formar um triângulo retângulo com lados inteiros singulares, enquanto outros comprimentos permitem que se encontre mais de uma solução. Por exemplo, usar 120 cm torna possível formar exatamente três triângulos retângulos com lados inteiros singulares.
120 cm: (30,40,50), (20,48,52), (24,45,51)

-Given that L is the length of the wire, for how many values of L ≤ `n` can exactly one, integer sided right angle, triangle be formed? +Considerando que L é o comprimento do fio, para quantos valores de L ≤ `n` é possível formar exatamente um triângulo retângulo de lados inteiros e singulares? # --hints-- -`singularIntRightTriangles(48)` should return a number. +`singularIntRightTriangles(48)` deve retornar um número. ```js assert(typeof singularIntRightTriangles(48) === 'number'); ``` -`singularIntRightTriangles(48)` should return `6`. +`singularIntRightTriangles(48)` deve retornar `6`. ```js assert.strictEqual(singularIntRightTriangles(48), 6); ``` -`singularIntRightTriangles(700000)` should return `75783`. +`singularIntRightTriangles(700000)` deve retornar `75783`. ```js assert.strictEqual(singularIntRightTriangles(700000), 75783); ``` -`singularIntRightTriangles(1000000)` should return `107876`. +`singularIntRightTriangles(1000000)` deve retornar `107876`. ```js assert.strictEqual(singularIntRightTriangles(1000000), 107876); ``` -`singularIntRightTriangles(1500000)` should return `161667`. +`singularIntRightTriangles(1500000)` deve retornar `161667`. ```js assert.strictEqual(singularIntRightTriangles(1500000), 161667); diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-78-coin-partitions.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-78-coin-partitions.md index 61f145116f..599fc4697d 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-78-coin-partitions.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-78-coin-partitions.md @@ -1,6 +1,6 @@ --- id: 5900f3ba1000cf542c50fecd -title: 'Problem 78: Coin partitions' +title: 'Problema 78: Partições de moedas' challengeType: 5 forumTopicId: 302191 dashedName: problem-78-coin-partitions @@ -8,51 +8,51 @@ dashedName: problem-78-coin-partitions # --description-- -Let ${p}(n)$ represent the number of different ways in which `n` coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so ${p}(5) = 7$. +Consideremos que ${p}(n)$ representa o número de diferentes maneiras pelas quais `n` moedas podem ser separadas em pilhas. Por exemplo, cinco moedas podem ser separadas em pilhas de exatamente sete maneiras diferentes, então ${p}(5) = 7$.
-| Coin piles | +| Pilhas de moedas | | ----------------- | | OOOOO | -| OOOO   O | -| OOO   OO | -| OOO   O   O | -| OO   OO   O | -| OO   O   O   O | -| O   O   O   O   O | +| OOOO O | +| OOO OO | +| OOO O O | +| OO OO O | +| OO O O O | +| O O O O O |

-Find the least value of `n` for which ${p}(n)$ is divisible by `divisor`. +Encontre o menor valor de `n` para o qual ${p}(n)$ é divisível pelo `divisor`. # --hints-- -`coinPartitions(7)` should return a number. +`coinPartitions(7)` deve retornar um número. ```js assert(typeof coinPartitions(7) === 'number'); ``` -`coinPartitions(7)` should return `5`. +`coinPartitions(7)` deve retornar `5`. ```js assert.strictEqual(coinPartitions(7), 5); ``` -`coinPartitions(10000)` should return `599`. +`coinPartitions(10000)` deve retornar `599`. ```js assert.strictEqual(coinPartitions(10000), 599); ``` -`coinPartitions(100000)` should return `11224`. +`coinPartitions(100000)` deve retornar `11224`. ```js assert.strictEqual(coinPartitions(100000), 11224); ``` -`coinPartitions(1000000)` should return `55374`. +`coinPartitions(1000000)` deve retornar `55374`. ```js assert.strictEqual(coinPartitions(1000000), 55374);