From aecc082d088e1274e224d30e323ea9520d37a91c Mon Sep 17 00:00:00 2001 From: camperbot <dev@freecodecamp.org> Date: Wed, 8 Jan 2025 13:39:39 +0000 Subject: [PATCH] chore(i18n,learn): processed translations --- .../64ec9343769e8f85c1e17e05.md | 8 +- .../word-problems.md | 4 +- ...oduction-to-college-algebra-with-python.md | 4 +- .../66c62747744dc4178785207d.md | 2 +- .../66def5467aee701733aaf8cc.md | 114 ++++++++++++-- .../66c06fad3475cd92421b9ac2.md | 8 +- .../669e2f60e83c011754f711f9.md | 4 +- .../6734e2c5780912abd874e79c.md | 24 +-- .../672d269da46786225e3fe3fd.md | 2 +- .../673263e80dd43da7df3ae565.md | 12 +- .../66ed8fa2f45ce3ece4053eab.md | 2 +- .../66ed9010f45ce3ece4053eb8.md | 4 +- .../669fd6fd12918e3de87854d4.md | 2 +- .../66a98f42c7c06903e5f8dd07.md | 2 +- .../66a9b48a211a73155621d0df.md | 6 +- .../66a9b8f14b963916a3baa732.md | 2 +- .../66a9bb8578459a175432e7d0.md | 10 +- .../66a9bcf00f13a418368a272e.md | 10 +- .../66a9c006e4f58819396605b3.md | 9 +- .../66a9c14e3b34c719e34bae20.md | 36 ++--- .../66a9c7a4521d2b1b1ec6dcf0.md | 25 ++-- .../66a9ca099e3ecb1be10a2696.md | 25 ++-- .../66a9cb26ec6bd41cf6c82bc5.md | 10 +- .../64ec9343769e8f85c1e17e05.md | 8 +- .../64ec9343769e8f85c1e17e05.md | 8 +- .../word-problems.md | 4 +- ...oduction-to-college-algebra-with-python.md | 4 +- .../66c62747744dc4178785207d.md | 2 +- .../66def5467aee701733aaf8cc.md | 114 ++++++++++++-- .../66c06fad3475cd92421b9ac2.md | 8 +- .../669e2f60e83c011754f711f9.md | 4 +- .../6734e2c5780912abd874e79c.md | 24 +-- .../672d269da46786225e3fe3fd.md | 2 +- .../673263e80dd43da7df3ae565.md | 12 +- .../66ed8fa2f45ce3ece4053eab.md | 2 +- .../66ed9010f45ce3ece4053eb8.md | 4 +- .../669fd6fd12918e3de87854d4.md | 2 +- .../66a98f42c7c06903e5f8dd07.md | 2 +- .../66a9b48a211a73155621d0df.md | 6 +- .../66a9b8f14b963916a3baa732.md | 2 +- .../66a9bb8578459a175432e7d0.md | 10 +- .../66a9bcf00f13a418368a272e.md | 10 +- .../66a9c006e4f58819396605b3.md | 9 +- .../66a9c14e3b34c719e34bae20.md | 36 ++--- .../66a9c7a4521d2b1b1ec6dcf0.md | 25 ++-- .../66a9ca099e3ecb1be10a2696.md | 25 ++-- .../66a9cb26ec6bd41cf6c82bc5.md | 10 +- .../64ec9343769e8f85c1e17e05.md | 8 +- .../basic-algorithm-scripting/boo-who.md | 22 +-- .../chunky-monkey.md | 4 +- .../confirm-the-ending.md | 33 +++-- .../convert-celsius-to-fahrenheit.md | 14 +- .../factorialize-a-number.md | 10 +- .../falsy-bouncer.md | 6 +- .../find-the-longest-word-in-a-string.md | 29 ++-- .../basic-algorithm-scripting/mutations.md | 38 +++-- .../repeat-a-string-repeat-a-string.md | 24 +-- .../return-largest-numbers-in-arrays.md | 18 ++- .../reverse-a-string.md | 15 +- .../slice-and-splice.md | 4 +- .../title-case-a-sentence.md | 17 ++- .../truncate-a-string.md | 30 ++-- .../where-do-i-belong.md | 54 +++---- .../657f456223b8c1187b461987.md | 3 +- .../5f356ed6cf6eab5f15f5cfe6.md | 5 + .../671141feba228a35cefba82d.md | 2 +- .../build-a-cash-register.md | 6 +- .../build-a-palindrome-checker.md | 2 +- .../build-a-pokemon-search-app.md | 4 +- .../build-a-telephone-number-validator.md | 2 +- .../655220a3fa5c3c200bc8e938.md | 2 +- .../6552385244ccf89b77d6b332.md | 12 +- .../655243068222c2c1166b90b0.md | 10 +- .../655476e1ff522252fdcce5e4.md | 6 +- .../655479aa3e1e0360ae38b7a6.md | 12 +- .../65547ee197840478a1b95f4b.md | 12 +- .../6554815fe2472f8bfdab7642.md | 10 +- .../655482742cc5499726e3f347.md | 14 +- .../655483ebf0096ba02b2c3d4c.md | 8 +- .../655487f686aabfc2a10ba887.md | 8 +- .../659b0093d7db5a1a1122b7bd.md | 8 +- .../64cb472593e3be6d10a7c13b.md | 4 +- .../64cb480723790d6d727b8ef5.md | 4 +- .../64ec9343769e8f85c1e17e05.md | 8 +- .../64475c0b61cddb6feaab4e2e.md | 2 +- .../word-problems.md | 4 +- ...oduction-to-college-algebra-with-python.md | 4 +- .../66b56d36cc47571a0e2a3dc5.md | 2 +- .../66bbc147bc59c25e60e18aec.md | 2 +- .../66c62747744dc4178785207d.md | 2 +- .../66ec4c8e9878d8441956516f.md | 2 +- .../66def5467aee701733aaf8cc.md | 114 ++++++++++++-- .../lab-event-hub/66ebd4ae2812430bb883c787.md | 25 +++- .../66ed41f912d0bb1dc62da5dd.md | 14 +- .../66c06fad3475cd92421b9ac2.md | 8 +- .../66f55eac933ff64ce654ca74.md | 140 +++++++++++++++++- .../657bdc55a322aae1eac3838f.md | 2 +- .../67051431a73f1ca25d9a6f25.md | 2 +- .../669e2f60e83c011754f711f9.md | 8 +- .../669e81368e52b3a5c35a2dc5.md | 5 +- .../672995ffdfd2f337f5f215f8.md | 2 +- .../6734e2c5780912abd874e79c.md | 24 +-- .../66f6db08d55022680a3cfbc9.md | 6 +- .../672d269da46786225e3fe3fd.md | 2 +- .../673263e80dd43da7df3ae565.md | 12 +- .../66ed8fa2f45ce3ece4053eab.md | 10 +- .../66ed8fe1f45ce3ece4053eb1.md | 6 +- .../66ed9010f45ce3ece4053eb8.md | 4 +- .../66ed901ff45ce3ece4053eba.md | 2 +- .../6723d2c154dd19d0025f7cd9.md | 2 +- .../6723d3cfdd0717d3f1bf27e3.md | 2 +- .../669fd6fd12918e3de87854d4.md | 2 +- .../5f356ed6cf6eab5f15f5cfe6.md | 5 + .../66cc0a9e06e00b75d6782be9.md | 2 +- .../64475c0b61cddb6feaab4e2e.md | 2 +- .../6464b1384318a5087190950a.md | 2 +- .../66a98f42c7c06903e5f8dd07.md | 2 +- .../66a9b48a211a73155621d0df.md | 6 +- .../66a9b8f14b963916a3baa732.md | 2 +- .../66a9bb8578459a175432e7d0.md | 10 +- .../66a9bcf00f13a418368a272e.md | 10 +- .../66a9c006e4f58819396605b3.md | 9 +- .../66a9c14e3b34c719e34bae20.md | 36 ++--- .../66a9c7a4521d2b1b1ec6dcf0.md | 25 ++-- .../66a9ca099e3ecb1be10a2696.md | 25 ++-- .../66a9cb26ec6bd41cf6c82bc5.md | 10 +- .../66a84111965a0c46df6bbd0a.md | 2 +- .../66fbcf750a62784cf11f5630.md | 62 +++++++- .../66fbcf750a62784cf11f5631.md | 26 ++-- .../66fbcf750a62784cf11f5632.md | 26 ++-- .../66fbcf750a62784cf11f5633.md | 14 +- .../66fbcf750a62784cf11f5635.md | 22 ++- .../66fbcf750a62784cf11f5636.md | 18 +-- .../670e4f45f7116c0f216a5177.md | 32 ++-- .../64ec9343769e8f85c1e17e05.md | 8 +- .../64ec9343769e8f85c1e17e05.md | 8 +- .../word-problems.md | 4 +- ...oduction-to-college-algebra-with-python.md | 4 +- .../66c62747744dc4178785207d.md | 2 +- .../66def5467aee701733aaf8cc.md | 114 ++++++++++++-- .../66c06fad3475cd92421b9ac2.md | 8 +- .../669e2f60e83c011754f711f9.md | 4 +- .../6734e2c5780912abd874e79c.md | 24 +-- .../672d269da46786225e3fe3fd.md | 2 +- .../673263e80dd43da7df3ae565.md | 12 +- .../66ed8fa2f45ce3ece4053eab.md | 2 +- .../66ed9010f45ce3ece4053eb8.md | 4 +- .../669fd6fd12918e3de87854d4.md | 2 +- .../66a98f42c7c06903e5f8dd07.md | 2 +- .../66a9b48a211a73155621d0df.md | 6 +- .../66a9b8f14b963916a3baa732.md | 2 +- .../66a9bb8578459a175432e7d0.md | 10 +- .../66a9bcf00f13a418368a272e.md | 10 +- .../66a9c006e4f58819396605b3.md | 9 +- .../66a9c14e3b34c719e34bae20.md | 36 ++--- .../66a9c7a4521d2b1b1ec6dcf0.md | 25 ++-- .../66a9ca099e3ecb1be10a2696.md | 25 ++-- .../66a9cb26ec6bd41cf6c82bc5.md | 10 +- .../64ec9343769e8f85c1e17e05.md | 8 +- 159 files changed, 1401 insertions(+), 824 deletions(-) diff --git a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md index 71c395c2c1..51f0034c55 100644 --- a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ dashedName: step-24 你應該創建一個帶有類 `task` 的 `div` 元素。 ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` 你的 `div` 元素應該具有 `id` `${id}`。 ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md b/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md index ea6a5ced36..29f4a08c00 100644 --- a/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md +++ b/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md @@ -14,7 +14,9 @@ dashedName: word-problems \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">《商業數學分步手冊(2021)》,作者 Jean-Paul Oliver</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">《代數與三角學》,作者 Jay Abramson</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md b/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md index cfffc281f3..19147fa9cc 100644 --- a/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md +++ b/curriculum/challenges/chinese-traditional/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md @@ -14,7 +14,9 @@ dashedName: introduction-to-college-algebra-with-python \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">《商業數學分步手冊(2021)》,作者 Jean-Paul Oliver</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">《代數與三角學》,作者 Jay Abramson</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/chinese-traditional/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md b/curriculum/challenges/chinese-traditional/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md index dc90df92b0..d62e911d9d 100644 --- a/curriculum/challenges/chinese-traditional/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md +++ b/curriculum/challenges/chinese-traditional/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md @@ -40,7 +40,7 @@ Because the IDEs are not installed correctly. ### --feedback-- -TOm is not frustrated about instalation. +Tom is not frustrated about installation. --- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md index db9366bd10..dcc9cce60f 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md @@ -14,7 +14,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab **用戶需求:** -1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, the `getBookmarks` function should return an empty array. +1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, or it doesn't contain a valid array with bookmarks, the `getBookmarks` function should return an empty array. 1. The `bookmarks` key stored in the local storage should be an array of bookmark objects. Each bookmark object should have three keys: `name`, `category`, and `url`. 1. You should have a function named `displayOrCloseForm` that toggles the `hidden` class on `#main-section` and `#form-section`. 1. When you click `#add-bookmark-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown` and call `displayOrCloseForm` to display the form section and hide the main section. @@ -24,10 +24,10 @@ Fulfill the user stories below and get all the tests to pass to complete the lab 1. You should have a function named `displayOrHideCategory` that toggles the `hidden` class on `#main-section` and `#bookmark-list-section`. 1. When you click `#view-category-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown`, modify the inner HTML of `#category-list` according to the user stories below, and call the `displayOrHideCategory` function. 1. If none of the bookmarks in local storage have the category, you should set the inner HTML of the `#category-list` to a `p` element with the text `No Bookmarks Found`. -1. If one or more bookmarks in local storage have the selected category you should add a radio button with `id` and `value` attributes set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. +1. If one or more bookmarks in local storage have the selected category, you should add a radio button with `id` and `value` attributes, and set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. Additionally, each radio button should have the same `name` attribute. 1. Each radio button should have a corresponding label containing an anchor element with the bookmark name and the `href` attribute set to the bookmark URL. -1. When you click `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. -1. When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +1. When you click the `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. +1. When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. # --hints-- @@ -69,6 +69,24 @@ try { } ``` +When the `bookmarks` key in the `localStorage` does not contain a valid array of bookmark objects, the `getBookmarks` function should return an empty array. + +```js +try { + localStorage.setItem("bookmarks", 'invalid'); + const arrayFromInvalidValue = getBookmarks(); + assert.isArray(arrayFromInvalidValue); + assert.isEmpty(arrayFromInvalidValue); + + localStorage.setItem("bookmarks", JSON.stringify([{name: "example1", category: "news", notUrl: "example1.com"}])); + const arrayFromInvalidArray = getBookmarks(); + assert.isArray(arrayFromInvalidArray) + assert.isEmpty(arrayFromInvalidArray) +} finally { + resetLocalStorage(); +} +``` + You should have a function named `displayOrCloseForm`. ```js @@ -201,7 +219,7 @@ try { } ``` -When you click `#view-category-button`, you should modify `#category-list`'s inner HTML by adding a radio button having the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. +When you click the `#view-category-button`, you should modify the `#category-list` element's inner HTML by adding a radio button. The radio button should have the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. Additionally, each radio button should have the same `name` attribute. ```js try { @@ -214,6 +232,8 @@ try { assert.strictEqual(bookmarksDisplayed[0].value, "example1"); assert.strictEqual(bookmarksDisplayed[1].id, "example4"); assert.strictEqual(bookmarksDisplayed[1].value, "example4"); + assert.isOk(bookmarksDisplayed[0].name) + assert.strictEqual(bookmarksDisplayed[0].name, bookmarksDisplayed[1].name); } finally { resetLocalStorage(); } @@ -262,7 +282,49 @@ closeListButtonTest.dispatchEvent(new Event("click")); assert.strictEqual(getHidden("bookmark list"), "bookmark list"); ``` -When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +When you click the `#close-list-button` and then open any category, the `#category-list` should contain only data relevant for the selected category, without duplicating entries. + +```js +setLocalStorage(); +try { + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const categoryList = document.getElementById("category-list").innerHTML; + assert.strictEqual(categoryList, "<p>No Bookmarks Found</p>"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "news"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const newsBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(newsBookmarks, 2); + assert.strictEqual(newsBookmarks[0].id, "example1"); + assert.strictEqual(newsBookmarks[0].value, "example1"); + assert.strictEqual(newsBookmarks[1].id, "example4"); + assert.strictEqual(newsBookmarks[1].value, "example4"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "work"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const workBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(workBookmarks, 1); + assert.strictEqual(workBookmarks[0].id, "example3"); + assert.strictEqual(workBookmarks[0].value, "example3"); + + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const paragraphs = document.querySelectorAll("#category-list p"); + assert.lengthOf(paragraphs, 1); + assert.strictEqual(paragraphs[0].innerText, "No Bookmarks Found"); +} finally { + resetLocalStorage(); + clearCategoryList(); +} +``` + +When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. ```js setLocalStorage(); @@ -282,6 +344,16 @@ try { const expected = [{name: "example2", category: "entertainment", url: "example2.com"}, {name: "example3", category: "work", url: "example3.com"}, {name: "example4", category: "news", url: "example4.com"}]; assert.deepEqual(getBookmarks(), expected); + localStorage.setItem("bookmarks", JSON.stringify([{name: "duplicated-name", category: "news", url: "example1.com"}, {name: "duplicated-name", category: "entertainment", url: "example2.com"}])); + + categoryDropdownTest.value = "entertainment"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const radioForDuplicate = document.querySelector('#category-list input[type="radio"]'); + radioForDuplicate.checked = true; + + deleteBookmarkButtonTest.dispatchEvent(new Event("click")); + + assert.deepEqual(getBookmarks(), [{name: "duplicated-name", category: "news", url: "example1.com"}]) } finally { resetLocalStorage(); } @@ -529,7 +601,26 @@ const addBookmarkButtonForm = document.getElementById("add-bookmark-button-form" const categoryList = document.getElementById("category-list"); const closeListButton = document.getElementById("close-list-button"); const deleteBookmarkButton = document.getElementById("delete-bookmark-button"); -const getBookmarks = () => JSON.parse(localStorage.getItem("bookmarks")) || []; + +const getBookmarks = () => { + try { + const parsed = JSON.parse(localStorage.getItem("bookmarks")); + if ( + Array.isArray(parsed) && + parsed.every( + (item) => + item.hasOwnProperty("category") && + item.hasOwnProperty("name") && + item.hasOwnProperty("url"), + ) + ) { + return parsed; + } + return []; + } catch { + return []; + } +}; const displayOrCloseForm = () => { mainSection.classList.toggle("hidden"); @@ -570,12 +661,7 @@ const displayOrHideCategory = () => { const fillBookmarkList = () => { categoryHeading[1].innerText = categoryDropdown.value.charAt(0).toUpperCase() + categoryDropdown.value.slice(1); - const bookmarksToDisplay = getBookmarks().filter((i) => { - if (i.category === categoryDropdown.value) { - return true - } - return false - }); + const bookmarksToDisplay = getBookmarks().filter((i) => i.category === categoryDropdown.value); if (bookmarksToDisplay.length) { categoryList.innerHTML = ''; for (const bookmark of bookmarksToDisplay) { @@ -604,7 +690,7 @@ const deleteBookmark = () => { for (const radioBookmark of radioBookmarks) { if (radioBookmark.checked) { const bookmarks = getBookmarks(); - const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value); + const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value && i.category === categoryDropdown.value); bookmarks.splice(indexToRemove, 1); localStorage.setItem("bookmarks", JSON.stringify(bookmarks)); return diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md index 094658ab72..76a96dd915 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md @@ -58,6 +58,12 @@ With `2024` as the value of the `year` variable, the `result` should be `2024 is assert.strictEqual(isLeapYear(2024), '2024 is a leap year.'); ``` +With `2000` as the value of the `year` variable, the `result` should be `2000 is a leap year.`. + +```js +assert.strictEqual(isLeapYear(2000), '2000 is a leap year.'); +``` + With `1900` as the value of the `year` variable, the `result` should be `1900 is not a leap year.`. ```js @@ -74,7 +80,7 @@ assert.match(__helpers.removeJSComments(code), /isLeapYear\(\s*year\s*\)/); You should store the result of calling the `isLeapYear` function in a variable named `result`. ```js -assert.match(__helpers.removeJSComments(code), /const\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); +assert.match(__helpers.removeJSComments(code), /(?:var|let|const)\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); ``` You should output the `result` to the console using `console.log()`. diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md index 6064ce4be4..2d2ed44114 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md @@ -159,13 +159,13 @@ for (let e of listItems) { The anchor element of your first list item should wrap the text `Group Travels`. ```js -assert.equal(document.querySelectorAll('a')[0]?.innerText, 'Group Travels'); +assert.equal(document.querySelectorAll('li > a')[0]?.innerText, 'Group Travels'); ``` The anchor element of your second list item should wrap the text `Private Tours`. ```js -assert.equal(document.querySelectorAll('a')[1]?.innerText, 'Private Tours'); +assert.equal(document.querySelectorAll('li > a')[1]?.innerText, 'Private Tours'); ``` You should have an `h2` element after your unordered list. diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md index cfa1be8adc..08fe131107 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md @@ -86,36 +86,36 @@ All of the above. ## --text-- -What is the recommended strategy for pacing yourself through the freeCodeCamp certification coursework? +What makes each freeCodeCamp certification unique? ## --answers-- -Code for several hours one day a week. +It has its own unique verification URL. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Code for half an hour every day. - ---- - -Complete all coursework in one month. +It has its own unique serial number. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Work only on weekends. +It has its own QR code. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. + +--- + +All of the above. ## --video-solution-- -2 +4 diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md index bbd535265b..c5d6ecb6eb 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md @@ -2,7 +2,7 @@ id: 672d269da46786225e3fe3fd title: What Is the Purpose of Functions, and How Do They Work? challengeType: 11 -videoId: sU2mIGNjBtc +videoId: maLeO3YCqxs dashedName: what-is-the-purpose-of-functions-and-how-do-they-work --- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md b/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md index d9f2af9f09..9999634949 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md @@ -86,7 +86,7 @@ Remember, you can pass a second argument to the method to control where the sear ## --text-- -What type of function is `indexOf` in JavaScript? +What type of method is `indexOf` in JavaScript? ## --answers-- @@ -94,15 +94,15 @@ A standalone function. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- -A method of the `Array` object. +A method of the `Date` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- @@ -110,11 +110,11 @@ A method of the `String` object. --- -A mathematical function. +A method of the `Math` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. ## --video-solution-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md b/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md index 06e0471e54..090bfa7177 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md @@ -215,7 +215,7 @@ Which selector is correct to target the next sibling of an `img`? #### --text-- -Which selector is correct to target all siblings of an `img`? +Which selector is correct to target all siblings preceded by an `img` element? #### --distractors-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md b/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md index 6c8140bf6d..45ba4f942a 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md @@ -171,7 +171,7 @@ It allows you to use custom fonts by importing them #### --text-- -Which service offers a large selection of free fonts for use on websites? +Which service offers a large selection of free fonts that can be easily integrated directly into websites? #### --distractors-- @@ -183,7 +183,7 @@ Adobe Fonts --- -Font Squirrel +Font Universe #### --answer-- diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md index 4284dd5d1f..ca15317df9 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md @@ -9,7 +9,7 @@ dashedName: step-8 For your blog, there should be a way for users to navigate to different sections on the page. -The `nav` element is used to to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. +The `nav` element is used to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. Here is an example of using the `nav` element: diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md index 147f9235fe..34abc04c6a 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md @@ -8,7 +8,7 @@ demoType: onLoad # --description-- -In this workshop, you will learn how to work with HTML tables by building a final exam table for a group of students. +In this workshop, you will practice working with HTML tables by building a final exam table for a group of students. To begin the project, add the `<!DOCTYPE html>`, and an `html` element with a `lang` attribute of `en`. diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md index 9e59b9a73b..e8d258e4d9 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md @@ -29,7 +29,7 @@ Your `table` element should be inside your `body` element. ```js const tableEl = document.querySelector('table'); -assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); +assert.strictEqual(tableEl?.parentElement?.tagName, 'BODY'); ``` # --seed-- @@ -44,9 +44,9 @@ assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); <meta charset="UTF-8" /> </head> <body> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </body> </html> ``` diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md index 018e6eea8b..9a40075d53 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -To add a caption to a `table`, you can use the table <dfn>caption</dfn> element. +To add a caption to a `table`, you can use the <dfn>table caption</dfn> element. Here is an example using the `caption` element: diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md index 31196d7268..b0985230a9 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md @@ -9,7 +9,7 @@ dashedName: step-5 For the first section of the table, you will want to group the header content which represents the column labels for the student's first name, last name, and final exam grade. -The `table head` element, `<thead>`, is used to group the header content in a table. +The <dfn>table head</dfn> element, `thead`, is used to group the header content in a table. Here is an example using the `thead` element: @@ -21,7 +21,7 @@ Here is an example using the `thead` element: </table> ``` -Below your `caption` element, add a `table head` element. +Below your `caption` element, add a table head element. # --hints-- @@ -41,7 +41,7 @@ Your `thead` element should be inside your `table` element. ```js const theadEl = document.querySelector('thead'); -assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); +assert.strictEqual(theadEl?.parentElement?.tagName, 'TABLE'); ``` # --seed-- @@ -60,9 +60,9 @@ assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); <caption> Calculus Final Exam Grades </caption> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md index e48987f952..964ecc115d 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -The `table head` element consists of a `table row` element, `<tr>`, which contains the `table header` cell elements, `<th>`. +The table head element consists of a <dfn>table row</dfn> element, `tr`, which contains the <dfn>table header cell</dfn> elements, `th`. Here is an example using the `tr` and `th` elements for a sports table: @@ -48,28 +48,28 @@ Your `tr` element should be inside your `thead` element. ```js const trEl = document.querySelector('tr'); -assert.strictEqual(trEl.parentElement.tagName, 'THEAD'); +assert.strictEqual(trEl?.parentElement?.tagName, 'THEAD'); ``` Your first `th` element should have the text of `Last Name`. ```js const thEl = document.querySelectorAll('th')[0]; -assert.strictEqual(thEl.textContent, 'Last Name'); +assert.strictEqual(thEl?.textContent, 'Last Name'); ``` Your second `th` element should have the text of `First Name`. ```js const thEl = document.querySelectorAll('th')[1]; -assert.strictEqual(thEl.textContent, 'First Name'); +assert.strictEqual(thEl?.textContent, 'First Name'); ``` Your third `th` element should have the text of `Grade`. ```js const thEl = document.querySelectorAll('th')[2]; -assert.strictEqual(thEl.textContent, 'Grade'); +assert.strictEqual(thEl?.textContent, 'Grade'); ``` All of your `th` elements should be inside your `tr` element. diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md index 70b2ecd93f..f14ef06326 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md @@ -7,9 +7,9 @@ dashedName: step-7 # --description-- -Now that you have completed the head section, it is time to add the `table body`. The `table body` will represent all of the student names and their grades. +Now that you have completed the head section, it is time to add the <dfn>table body</dfn>, `tbody`. The table body will represent all of the student names and their grades. -Add a `table body` element to your table. +Add a table body element to your table. # --hints-- @@ -55,10 +55,9 @@ assert.match(code, /<tbody>[\s\S]*<\/tbody>/i); <th>Grade</th> </tr> </thead> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md index e5a750b188..c78c350929 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md @@ -7,9 +7,9 @@ dashedName: step-8 # --description-- -To add student data to the table, you will need to use the `table row` and <dfn>table data</dfn> elements. +To add student data to the table, you will need to use the table row and table data elements. -The `table data` element, `<td>`, is used to create a cell in the table. +The <dfn>table data</dfn> element, `td`, is used to create a cell in the table. Here is an example of using the `td` element for a sports players table: @@ -21,29 +21,17 @@ Here is an example of using the `td` element for a sports players table: </tr> ``` -Inside your `table body` element, add a `table row` element, `<tr>`, with three `table data` elements, `<td>`. +Inside your table body element, add a table row element, `tr`, with three table data elements, `td`. -The first `table data` element should contain the last name of `Davis`. +The first table data element should contain the last name of `Davis`. -The second `table data` element should contain the first name of `Alex`. +The second table data element should contain the first name of `Alex`. -The third `table data` element should contain the grade of `54`. +The third table data element should contain the grade of `54`. # --hints-- -You should have an opening `tr` tag. - -```js -assert.match(code, /<tr>/i); -``` - -You should have a closing `tr` tag. - -```js -assert.match(code, /<\/tr>/i); -``` - -Your `tr` element should be inside your `tbody` element. +You should have a `tr` element inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr')); @@ -52,19 +40,19 @@ assert.isNotNull(document.querySelector('tbody tr')); You should have a `td` element with the text `Davis` inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr td').textContent, 'Davis'); +assert.strictEqual(document.querySelector('tbody tr td')?.textContent, 'Davis'); ``` You should have a `td` element with the text `Alex` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[1].textContent, 'Alex'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[1]?.textContent, 'Alex'); ``` You should have a `td` element with the text `54` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[2].textContent, '54'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[2]?.textContent, '54'); ``` You should have all three of the `td` elements inside the `tr` element. @@ -99,9 +87,9 @@ assert.match(code, /<tr>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*< </thead> <tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md index bbc3eec319..04a5b68384 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md @@ -9,13 +9,13 @@ dashedName: step-9 Now it is time to add two more students to the table. -Following the same pattern as the previous step, add a second student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous step, add a second student table row. Use the following data for the table data elements: - Last Name: `Doe` - First Name: `Samantha` - Grade: `92` -For the third student `table row`, use the following data for the `table data` elements: +For the third student table row, use the following data for the table data elements: - Last Name: `Rodriguez` - First Name: `Marcus` @@ -23,7 +23,7 @@ For the third student `table row`, use the following data for the `table data` e # --hints-- -You should have a second `table row` inside your `tbody` element. +You should have a second `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); You should have a `td` element with the text `Doe` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child').textContent, 'Doe'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child')?.textContent, 'Doe'); ``` You should have a `td` element with the text `Samantha` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)').textContent, 'Samantha'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)')?.textContent, 'Samantha'); ``` You should have a `td` element with the text `92` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child').textContent, '92'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child')?.textContent, '92'); ``` -You should have a third `table row` inside your `tbody` element. +You should have a third `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); You should have a `td` element with the text `Rodriguez` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child').textContent, 'Rodriguez'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child')?.textContent, 'Rodriguez'); ``` You should have a `td` element with the text `Marcus` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)').textContent, 'Marcus'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)')?.textContent, 'Marcus'); ``` You should have a `td` element with the text `88` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child').textContent, '88'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child')?.textContent, '88'); ``` # --seed-- @@ -102,10 +102,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child <td>Alex</td> <td>54</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md index d24bbc4c68..e25ec6a0c9 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md @@ -9,13 +9,13 @@ dashedName: step-10 Now it is time to add two more students to the table. -Following the same pattern as the previous steps, add a fourth student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous steps, add a fourth student table row. Use the following data for the table data elements: - Last Name: `Thompson` - First Name: `Jane` - Grade: `77` -For the fifth student `table row`, use the following data for the `table data` elements: +For the fifth student table row, use the following data for the table data elements: - Last Name: `Williams` - First Name: `Natalie` @@ -23,7 +23,7 @@ For the fifth student `table row`, use the following data for the `table data` e # --hints-- -You should have a fourth `table row` inside your `tbody` element. +You should have a fourth `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); You should have a `td` element with the text `Thompson` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child').textContent, 'Thompson'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child')?.textContent, 'Thompson'); ``` You should have a `td` element with the text `Jane` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)').textContent, 'Jane'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)')?.textContent, 'Jane'); ``` You should have a `td` element with the text `77` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)').textContent, '77'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)')?.textContent, '77'); ``` -You should have a fifth `table row` inside your `tbody` element. +You should have a fifth `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); You should have a `td` element with the text `Williams` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child').textContent, 'Williams'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child')?.textContent, 'Williams'); ``` You should have a `td` element with the text `Natalie` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)').textContent, 'Natalie'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)')?.textContent, 'Natalie'); ``` You should have a `td` element with the text `83` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)').textContent, '83'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)')?.textContent, '83'); ``` # --seed-- @@ -114,10 +114,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-typ <td>Marcus</td> <td>88</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md index 84b4d3aa56..3cc6f2a9f6 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -The last section to add to the table would be the `table foot` (`<tfoot>`) element. The `table foot` element will be used to display the average grade for all of the students in the table. +The last section to add to the table would be the <dfn>table foot</dfn> element, `tfoot`. The table foot element will be used to display the average grade for all of the students in the table. Add a `tfoot` element to the table. @@ -40,13 +40,13 @@ assert.isNotNull(document.querySelector('tfoot tr')); Your first `td` element should contain the text `Average Grade`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:first-child').textContent, 'Average Grade'); +assert.strictEqual(document.querySelector('tfoot tr td:first-child')?.textContent, 'Average Grade'); ``` Your second `td` element should contain the text `78.8`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)').textContent, '78.8'); +assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)')?.textContent, '78.8'); ``` Your `tr` element should have two `td` elements inside it. @@ -111,9 +111,9 @@ assert.strictEqual(document.querySelectorAll('tfoot tr td').length, 2); <td>83</td> </tr> </tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md index f4fd5f59fe..5cbadd7911 100644 --- a/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/chinese-traditional/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set You should create a `div` element with the class `task`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` Your `div` element should have the `id` `${id}`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md index 1f36d73e9b..1c32a9c70e 100644 --- a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ dashedName: step-24 你应该创建一个带有类 `task` 的 `div` 元素。 ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` 你的 `div` 元素应该具有 `id` `${id}`。 ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/chinese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md b/curriculum/challenges/chinese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md index 9dbbea3d3e..36f074f352 100644 --- a/curriculum/challenges/chinese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md +++ b/curriculum/challenges/chinese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md @@ -14,7 +14,9 @@ dashedName: word-problems \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">《商业数学分步手册(2021)》,作者 Jean-Paul Oliver</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">《代数与三角学》,作者 Jay Abramson</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/chinese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md b/curriculum/challenges/chinese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md index 13c178488b..0969046473 100644 --- a/curriculum/challenges/chinese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md +++ b/curriculum/challenges/chinese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md @@ -14,7 +14,9 @@ dashedName: introduction-to-college-algebra-with-python \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">《商业数学分步手册(2021)》,作者 Jean-Paul Oliver</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">《代数与三角学》,作者 Jay Abramson</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/chinese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md b/curriculum/challenges/chinese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md index dc90df92b0..d62e911d9d 100644 --- a/curriculum/challenges/chinese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md +++ b/curriculum/challenges/chinese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md @@ -40,7 +40,7 @@ Because the IDEs are not installed correctly. ### --feedback-- -TOm is not frustrated about instalation. +Tom is not frustrated about installation. --- diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md b/curriculum/challenges/chinese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md index 56563fe553..2db9dac847 100644 --- a/curriculum/challenges/chinese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md +++ b/curriculum/challenges/chinese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md @@ -14,7 +14,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab **用户需求:** -1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, the `getBookmarks` function should return an empty array. +1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, or it doesn't contain a valid array with bookmarks, the `getBookmarks` function should return an empty array. 1. The `bookmarks` key stored in the local storage should be an array of bookmark objects. Each bookmark object should have three keys: `name`, `category`, and `url`. 1. You should have a function named `displayOrCloseForm` that toggles the `hidden` class on `#main-section` and `#form-section`. 1. When you click `#add-bookmark-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown` and call `displayOrCloseForm` to display the form section and hide the main section. @@ -24,10 +24,10 @@ Fulfill the user stories below and get all the tests to pass to complete the lab 1. You should have a function named `displayOrHideCategory` that toggles the `hidden` class on `#main-section` and `#bookmark-list-section`. 1. When you click `#view-category-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown`, modify the inner HTML of `#category-list` according to the user stories below, and call the `displayOrHideCategory` function. 1. If none of the bookmarks in local storage have the category, you should set the inner HTML of the `#category-list` to a `p` element with the text `No Bookmarks Found`. -1. If one or more bookmarks in local storage have the selected category you should add a radio button with `id` and `value` attributes set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. +1. If one or more bookmarks in local storage have the selected category, you should add a radio button with `id` and `value` attributes, and set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. Additionally, each radio button should have the same `name` attribute. 1. Each radio button should have a corresponding label containing an anchor element with the bookmark name and the `href` attribute set to the bookmark URL. -1. When you click `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. -1. When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +1. When you click the `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. +1. When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. # --hints-- @@ -69,6 +69,24 @@ try { } ``` +When the `bookmarks` key in the `localStorage` does not contain a valid array of bookmark objects, the `getBookmarks` function should return an empty array. + +```js +try { + localStorage.setItem("bookmarks", 'invalid'); + const arrayFromInvalidValue = getBookmarks(); + assert.isArray(arrayFromInvalidValue); + assert.isEmpty(arrayFromInvalidValue); + + localStorage.setItem("bookmarks", JSON.stringify([{name: "example1", category: "news", notUrl: "example1.com"}])); + const arrayFromInvalidArray = getBookmarks(); + assert.isArray(arrayFromInvalidArray) + assert.isEmpty(arrayFromInvalidArray) +} finally { + resetLocalStorage(); +} +``` + You should have a function named `displayOrCloseForm`. ```js @@ -201,7 +219,7 @@ try { } ``` -When you click `#view-category-button`, you should modify `#category-list`'s inner HTML by adding a radio button having the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. +When you click the `#view-category-button`, you should modify the `#category-list` element's inner HTML by adding a radio button. The radio button should have the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. Additionally, each radio button should have the same `name` attribute. ```js try { @@ -214,6 +232,8 @@ try { assert.strictEqual(bookmarksDisplayed[0].value, "example1"); assert.strictEqual(bookmarksDisplayed[1].id, "example4"); assert.strictEqual(bookmarksDisplayed[1].value, "example4"); + assert.isOk(bookmarksDisplayed[0].name) + assert.strictEqual(bookmarksDisplayed[0].name, bookmarksDisplayed[1].name); } finally { resetLocalStorage(); } @@ -262,7 +282,49 @@ closeListButtonTest.dispatchEvent(new Event("click")); assert.strictEqual(getHidden("bookmark list"), "bookmark list"); ``` -When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +When you click the `#close-list-button` and then open any category, the `#category-list` should contain only data relevant for the selected category, without duplicating entries. + +```js +setLocalStorage(); +try { + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const categoryList = document.getElementById("category-list").innerHTML; + assert.strictEqual(categoryList, "<p>No Bookmarks Found</p>"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "news"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const newsBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(newsBookmarks, 2); + assert.strictEqual(newsBookmarks[0].id, "example1"); + assert.strictEqual(newsBookmarks[0].value, "example1"); + assert.strictEqual(newsBookmarks[1].id, "example4"); + assert.strictEqual(newsBookmarks[1].value, "example4"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "work"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const workBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(workBookmarks, 1); + assert.strictEqual(workBookmarks[0].id, "example3"); + assert.strictEqual(workBookmarks[0].value, "example3"); + + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const paragraphs = document.querySelectorAll("#category-list p"); + assert.lengthOf(paragraphs, 1); + assert.strictEqual(paragraphs[0].innerText, "No Bookmarks Found"); +} finally { + resetLocalStorage(); + clearCategoryList(); +} +``` + +When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. ```js setLocalStorage(); @@ -282,6 +344,16 @@ try { const expected = [{name: "example2", category: "entertainment", url: "example2.com"}, {name: "example3", category: "work", url: "example3.com"}, {name: "example4", category: "news", url: "example4.com"}]; assert.deepEqual(getBookmarks(), expected); + localStorage.setItem("bookmarks", JSON.stringify([{name: "duplicated-name", category: "news", url: "example1.com"}, {name: "duplicated-name", category: "entertainment", url: "example2.com"}])); + + categoryDropdownTest.value = "entertainment"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const radioForDuplicate = document.querySelector('#category-list input[type="radio"]'); + radioForDuplicate.checked = true; + + deleteBookmarkButtonTest.dispatchEvent(new Event("click")); + + assert.deepEqual(getBookmarks(), [{name: "duplicated-name", category: "news", url: "example1.com"}]) } finally { resetLocalStorage(); } @@ -529,7 +601,26 @@ const addBookmarkButtonForm = document.getElementById("add-bookmark-button-form" const categoryList = document.getElementById("category-list"); const closeListButton = document.getElementById("close-list-button"); const deleteBookmarkButton = document.getElementById("delete-bookmark-button"); -const getBookmarks = () => JSON.parse(localStorage.getItem("bookmarks")) || []; + +const getBookmarks = () => { + try { + const parsed = JSON.parse(localStorage.getItem("bookmarks")); + if ( + Array.isArray(parsed) && + parsed.every( + (item) => + item.hasOwnProperty("category") && + item.hasOwnProperty("name") && + item.hasOwnProperty("url"), + ) + ) { + return parsed; + } + return []; + } catch { + return []; + } +}; const displayOrCloseForm = () => { mainSection.classList.toggle("hidden"); @@ -570,12 +661,7 @@ const displayOrHideCategory = () => { const fillBookmarkList = () => { categoryHeading[1].innerText = categoryDropdown.value.charAt(0).toUpperCase() + categoryDropdown.value.slice(1); - const bookmarksToDisplay = getBookmarks().filter((i) => { - if (i.category === categoryDropdown.value) { - return true - } - return false - }); + const bookmarksToDisplay = getBookmarks().filter((i) => i.category === categoryDropdown.value); if (bookmarksToDisplay.length) { categoryList.innerHTML = ''; for (const bookmark of bookmarksToDisplay) { @@ -604,7 +690,7 @@ const deleteBookmark = () => { for (const radioBookmark of radioBookmarks) { if (radioBookmark.checked) { const bookmarks = getBookmarks(); - const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value); + const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value && i.category === categoryDropdown.value); bookmarks.splice(indexToRemove, 1); localStorage.setItem("bookmarks", JSON.stringify(bookmarks)); return diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md b/curriculum/challenges/chinese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md index 17e32ffc64..2d50ec3992 100644 --- a/curriculum/challenges/chinese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md +++ b/curriculum/challenges/chinese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md @@ -58,6 +58,12 @@ With `2024` as the value of the `year` variable, the `result` should be `2024 is assert.strictEqual(isLeapYear(2024), '2024 is a leap year.'); ``` +With `2000` as the value of the `year` variable, the `result` should be `2000 is a leap year.`. + +```js +assert.strictEqual(isLeapYear(2000), '2000 is a leap year.'); +``` + With `1900` as the value of the `year` variable, the `result` should be `1900 is not a leap year.`. ```js @@ -74,7 +80,7 @@ assert.match(__helpers.removeJSComments(code), /isLeapYear\(\s*year\s*\)/); You should store the result of calling the `isLeapYear` function in a variable named `result`. ```js -assert.match(__helpers.removeJSComments(code), /const\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); +assert.match(__helpers.removeJSComments(code), /(?:var|let|const)\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); ``` You should output the `result` to the console using `console.log()`. diff --git a/curriculum/challenges/chinese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md b/curriculum/challenges/chinese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md index 32423c0e1b..8f0f7d170b 100644 --- a/curriculum/challenges/chinese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md +++ b/curriculum/challenges/chinese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md @@ -159,13 +159,13 @@ for (let e of listItems) { The anchor element of your first list item should wrap the text `Group Travels`. ```js -assert.equal(document.querySelectorAll('a')[0]?.innerText, 'Group Travels'); +assert.equal(document.querySelectorAll('li > a')[0]?.innerText, 'Group Travels'); ``` The anchor element of your second list item should wrap the text `Private Tours`. ```js -assert.equal(document.querySelectorAll('a')[1]?.innerText, 'Private Tours'); +assert.equal(document.querySelectorAll('li > a')[1]?.innerText, 'Private Tours'); ``` You should have an `h2` element after your unordered list. diff --git a/curriculum/challenges/chinese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md b/curriculum/challenges/chinese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md index cfa1be8adc..08fe131107 100644 --- a/curriculum/challenges/chinese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md +++ b/curriculum/challenges/chinese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md @@ -86,36 +86,36 @@ All of the above. ## --text-- -What is the recommended strategy for pacing yourself through the freeCodeCamp certification coursework? +What makes each freeCodeCamp certification unique? ## --answers-- -Code for several hours one day a week. +It has its own unique verification URL. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Code for half an hour every day. - ---- - -Complete all coursework in one month. +It has its own unique serial number. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Work only on weekends. +It has its own QR code. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. + +--- + +All of the above. ## --video-solution-- -2 +4 diff --git a/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md b/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md index bbd535265b..c5d6ecb6eb 100644 --- a/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md +++ b/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md @@ -2,7 +2,7 @@ id: 672d269da46786225e3fe3fd title: What Is the Purpose of Functions, and How Do They Work? challengeType: 11 -videoId: sU2mIGNjBtc +videoId: maLeO3YCqxs dashedName: what-is-the-purpose-of-functions-and-how-do-they-work --- diff --git a/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md b/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md index d9f2af9f09..9999634949 100644 --- a/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md +++ b/curriculum/challenges/chinese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md @@ -86,7 +86,7 @@ Remember, you can pass a second argument to the method to control where the sear ## --text-- -What type of function is `indexOf` in JavaScript? +What type of method is `indexOf` in JavaScript? ## --answers-- @@ -94,15 +94,15 @@ A standalone function. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- -A method of the `Array` object. +A method of the `Date` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- @@ -110,11 +110,11 @@ A method of the `String` object. --- -A mathematical function. +A method of the `Math` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. ## --video-solution-- diff --git a/curriculum/challenges/chinese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md b/curriculum/challenges/chinese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md index 06e0471e54..090bfa7177 100644 --- a/curriculum/challenges/chinese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md +++ b/curriculum/challenges/chinese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md @@ -215,7 +215,7 @@ Which selector is correct to target the next sibling of an `img`? #### --text-- -Which selector is correct to target all siblings of an `img`? +Which selector is correct to target all siblings preceded by an `img` element? #### --distractors-- diff --git a/curriculum/challenges/chinese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md b/curriculum/challenges/chinese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md index 6c8140bf6d..45ba4f942a 100644 --- a/curriculum/challenges/chinese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md +++ b/curriculum/challenges/chinese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md @@ -171,7 +171,7 @@ It allows you to use custom fonts by importing them #### --text-- -Which service offers a large selection of free fonts for use on websites? +Which service offers a large selection of free fonts that can be easily integrated directly into websites? #### --distractors-- @@ -183,7 +183,7 @@ Adobe Fonts --- -Font Squirrel +Font Universe #### --answer-- diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md b/curriculum/challenges/chinese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md index e0e756f291..84b75f51e5 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md @@ -9,7 +9,7 @@ dashedName: step-8 For your blog, there should be a way for users to navigate to different sections on the page. -The `nav` element is used to to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. +The `nav` element is used to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. Here is an example of using the `nav` element: diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md index 9e12b19294..39135c38a4 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md @@ -8,7 +8,7 @@ demoType: onLoad # --description-- -In this workshop, you will learn how to work with HTML tables by building a final exam table for a group of students. +In this workshop, you will practice working with HTML tables by building a final exam table for a group of students. To begin the project, add the `<!DOCTYPE html>`, and an `html` element with a `lang` attribute of `en`. diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md index d1330a5df2..66de2cbf65 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md @@ -29,7 +29,7 @@ Your `table` element should be inside your `body` element. ```js const tableEl = document.querySelector('table'); -assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); +assert.strictEqual(tableEl?.parentElement?.tagName, 'BODY'); ``` # --seed-- @@ -44,9 +44,9 @@ assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); <meta charset="UTF-8" /> </head> <body> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </body> </html> ``` diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md index 46cf1b6200..af2ef3a63e 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -To add a caption to a `table`, you can use the table <dfn>caption</dfn> element. +To add a caption to a `table`, you can use the <dfn>table caption</dfn> element. Here is an example using the `caption` element: diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md index 032f8df1af..de6054d672 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md @@ -9,7 +9,7 @@ dashedName: step-5 For the first section of the table, you will want to group the header content which represents the column labels for the student's first name, last name, and final exam grade. -The `table head` element, `<thead>`, is used to group the header content in a table. +The <dfn>table head</dfn> element, `thead`, is used to group the header content in a table. Here is an example using the `thead` element: @@ -21,7 +21,7 @@ Here is an example using the `thead` element: </table> ``` -Below your `caption` element, add a `table head` element. +Below your `caption` element, add a table head element. # --hints-- @@ -41,7 +41,7 @@ Your `thead` element should be inside your `table` element. ```js const theadEl = document.querySelector('thead'); -assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); +assert.strictEqual(theadEl?.parentElement?.tagName, 'TABLE'); ``` # --seed-- @@ -60,9 +60,9 @@ assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); <caption> Calculus Final Exam Grades </caption> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md index 1ad9897a6e..ce2793c879 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -The `table head` element consists of a `table row` element, `<tr>`, which contains the `table header` cell elements, `<th>`. +The table head element consists of a <dfn>table row</dfn> element, `tr`, which contains the <dfn>table header cell</dfn> elements, `th`. Here is an example using the `tr` and `th` elements for a sports table: @@ -48,28 +48,28 @@ Your `tr` element should be inside your `thead` element. ```js const trEl = document.querySelector('tr'); -assert.strictEqual(trEl.parentElement.tagName, 'THEAD'); +assert.strictEqual(trEl?.parentElement?.tagName, 'THEAD'); ``` Your first `th` element should have the text of `Last Name`. ```js const thEl = document.querySelectorAll('th')[0]; -assert.strictEqual(thEl.textContent, 'Last Name'); +assert.strictEqual(thEl?.textContent, 'Last Name'); ``` Your second `th` element should have the text of `First Name`. ```js const thEl = document.querySelectorAll('th')[1]; -assert.strictEqual(thEl.textContent, 'First Name'); +assert.strictEqual(thEl?.textContent, 'First Name'); ``` Your third `th` element should have the text of `Grade`. ```js const thEl = document.querySelectorAll('th')[2]; -assert.strictEqual(thEl.textContent, 'Grade'); +assert.strictEqual(thEl?.textContent, 'Grade'); ``` All of your `th` elements should be inside your `tr` element. diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md index 22fb57ac4a..b6ea5cf0e0 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md @@ -7,9 +7,9 @@ dashedName: step-7 # --description-- -Now that you have completed the head section, it is time to add the `table body`. The `table body` will represent all of the student names and their grades. +Now that you have completed the head section, it is time to add the <dfn>table body</dfn>, `tbody`. The table body will represent all of the student names and their grades. -Add a `table body` element to your table. +Add a table body element to your table. # --hints-- @@ -55,10 +55,9 @@ assert.match(code, /<tbody>[\s\S]*<\/tbody>/i); <th>Grade</th> </tr> </thead> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md index 8855f260a6..79a329d009 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md @@ -7,9 +7,9 @@ dashedName: step-8 # --description-- -To add student data to the table, you will need to use the `table row` and <dfn>table data</dfn> elements. +To add student data to the table, you will need to use the table row and table data elements. -The `table data` element, `<td>`, is used to create a cell in the table. +The <dfn>table data</dfn> element, `td`, is used to create a cell in the table. Here is an example of using the `td` element for a sports players table: @@ -21,29 +21,17 @@ Here is an example of using the `td` element for a sports players table: </tr> ``` -Inside your `table body` element, add a `table row` element, `<tr>`, with three `table data` elements, `<td>`. +Inside your table body element, add a table row element, `tr`, with three table data elements, `td`. -The first `table data` element should contain the last name of `Davis`. +The first table data element should contain the last name of `Davis`. -The second `table data` element should contain the first name of `Alex`. +The second table data element should contain the first name of `Alex`. -The third `table data` element should contain the grade of `54`. +The third table data element should contain the grade of `54`. # --hints-- -You should have an opening `tr` tag. - -```js -assert.match(code, /<tr>/i); -``` - -You should have a closing `tr` tag. - -```js -assert.match(code, /<\/tr>/i); -``` - -Your `tr` element should be inside your `tbody` element. +You should have a `tr` element inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr')); @@ -52,19 +40,19 @@ assert.isNotNull(document.querySelector('tbody tr')); You should have a `td` element with the text `Davis` inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr td').textContent, 'Davis'); +assert.strictEqual(document.querySelector('tbody tr td')?.textContent, 'Davis'); ``` You should have a `td` element with the text `Alex` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[1].textContent, 'Alex'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[1]?.textContent, 'Alex'); ``` You should have a `td` element with the text `54` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[2].textContent, '54'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[2]?.textContent, '54'); ``` You should have all three of the `td` elements inside the `tr` element. @@ -99,9 +87,9 @@ assert.match(code, /<tr>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*< </thead> <tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md index 78f159e390..0d0cd9f3a8 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md @@ -9,13 +9,13 @@ dashedName: step-9 Now it is time to add two more students to the table. -Following the same pattern as the previous step, add a second student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous step, add a second student table row. Use the following data for the table data elements: - Last Name: `Doe` - First Name: `Samantha` - Grade: `92` -For the third student `table row`, use the following data for the `table data` elements: +For the third student table row, use the following data for the table data elements: - Last Name: `Rodriguez` - First Name: `Marcus` @@ -23,7 +23,7 @@ For the third student `table row`, use the following data for the `table data` e # --hints-- -You should have a second `table row` inside your `tbody` element. +You should have a second `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); You should have a `td` element with the text `Doe` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child').textContent, 'Doe'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child')?.textContent, 'Doe'); ``` You should have a `td` element with the text `Samantha` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)').textContent, 'Samantha'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)')?.textContent, 'Samantha'); ``` You should have a `td` element with the text `92` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child').textContent, '92'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child')?.textContent, '92'); ``` -You should have a third `table row` inside your `tbody` element. +You should have a third `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); You should have a `td` element with the text `Rodriguez` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child').textContent, 'Rodriguez'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child')?.textContent, 'Rodriguez'); ``` You should have a `td` element with the text `Marcus` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)').textContent, 'Marcus'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)')?.textContent, 'Marcus'); ``` You should have a `td` element with the text `88` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child').textContent, '88'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child')?.textContent, '88'); ``` # --seed-- @@ -102,10 +102,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child <td>Alex</td> <td>54</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md index 455886a6b6..a79c9bf7e3 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md @@ -9,13 +9,13 @@ dashedName: step-10 Now it is time to add two more students to the table. -Following the same pattern as the previous steps, add a fourth student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous steps, add a fourth student table row. Use the following data for the table data elements: - Last Name: `Thompson` - First Name: `Jane` - Grade: `77` -For the fifth student `table row`, use the following data for the `table data` elements: +For the fifth student table row, use the following data for the table data elements: - Last Name: `Williams` - First Name: `Natalie` @@ -23,7 +23,7 @@ For the fifth student `table row`, use the following data for the `table data` e # --hints-- -You should have a fourth `table row` inside your `tbody` element. +You should have a fourth `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); You should have a `td` element with the text `Thompson` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child').textContent, 'Thompson'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child')?.textContent, 'Thompson'); ``` You should have a `td` element with the text `Jane` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)').textContent, 'Jane'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)')?.textContent, 'Jane'); ``` You should have a `td` element with the text `77` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)').textContent, '77'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)')?.textContent, '77'); ``` -You should have a fifth `table row` inside your `tbody` element. +You should have a fifth `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); You should have a `td` element with the text `Williams` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child').textContent, 'Williams'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child')?.textContent, 'Williams'); ``` You should have a `td` element with the text `Natalie` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)').textContent, 'Natalie'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)')?.textContent, 'Natalie'); ``` You should have a `td` element with the text `83` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)').textContent, '83'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)')?.textContent, '83'); ``` # --seed-- @@ -114,10 +114,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-typ <td>Marcus</td> <td>88</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md index 340f35916f..70ed17a3a4 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -The last section to add to the table would be the `table foot` (`<tfoot>`) element. The `table foot` element will be used to display the average grade for all of the students in the table. +The last section to add to the table would be the <dfn>table foot</dfn> element, `tfoot`. The table foot element will be used to display the average grade for all of the students in the table. Add a `tfoot` element to the table. @@ -40,13 +40,13 @@ assert.isNotNull(document.querySelector('tfoot tr')); Your first `td` element should contain the text `Average Grade`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:first-child').textContent, 'Average Grade'); +assert.strictEqual(document.querySelector('tfoot tr td:first-child')?.textContent, 'Average Grade'); ``` Your second `td` element should contain the text `78.8`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)').textContent, '78.8'); +assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)')?.textContent, '78.8'); ``` Your `tr` element should have two `td` elements inside it. @@ -111,9 +111,9 @@ assert.strictEqual(document.querySelectorAll('tfoot tr td').length, 2); <td>83</td> </tr> </tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/chinese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/chinese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md index f4fd5f59fe..5cbadd7911 100644 --- a/curriculum/challenges/chinese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/chinese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set You should create a `div` element with the class `task`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` Your `div` element should have the `id` `${id}`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.md index 1b1157f28b..9c4332e379 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.md @@ -17,61 +17,61 @@ dashedName: boo-who `booWho(true)` は `true` を返す必要があります。 ```js -assert.strictEqual(booWho(true), true); +assert.isTrue(booWho(true)); ``` `booWho(false)` は `true` を返す必要があります。 ```js -assert.strictEqual(booWho(false), true); +assert.isTrue(booWho(false)); ``` `booWho([1, 2, 3])` は `false` を返す必要があります。 ```js -assert.strictEqual(booWho([1, 2, 3]), false); +assert.isFalse(booWho([1, 2, 3])); ``` `booWho([].slice)` は `false` を返す必要があります。 ```js -assert.strictEqual(booWho([].slice), false); +assert.isFalse(booWho([].slice)); ``` `booWho({ "a": 1 })` は `false` を返す必要があります 。 ```js -assert.strictEqual(booWho({ a: 1 }), false); +assert.isFalse(booWho({ a: 1 })); ``` `booWho(1)` は `false` を返す必要があります。 ```js -assert.strictEqual(booWho(1), false); +assert.isFalse(booWho(1)); ``` `booWho(NaN)` は `false` を返す必要があります。 ```js -assert.strictEqual(booWho(NaN), false); +assert.isFalse(booWho(NaN)); ``` `booWho("a")` は `false` を返す必要があります。 ```js -assert.strictEqual(booWho('a'), false); +assert.isFalse(booWho('a')); ``` `booWho("true")` は `false` を返す必要があります。 ```js -assert.strictEqual(booWho('true'), false); +assert.isFalse(booWho('true')); ``` `booWho("false")` は `false` を返す必要があります。 ```js -assert.strictEqual(booWho('false'), false); +assert.isFalse(booWho('false')); ``` # --seed-- @@ -90,7 +90,7 @@ booWho(null); ```js function booWho(bool) { - return typeof bool === "boolean"; + return typeof bool === 'boolean'; } booWho(null); diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md index 5d596e618b..af1a47dbc2 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.md @@ -90,7 +90,7 @@ function chunkArrayInGroups(arr, size) { return arr; } -chunkArrayInGroups(["a", "b", "c", "d"], 2); +chunkArrayInGroups(['a', 'b', 'c', 'd'], 2); ``` # --solutions-- @@ -106,5 +106,5 @@ function chunkArrayInGroups(arr, size) { return out; } -chunkArrayInGroups(["a", "b", "c", "d"], 2); +chunkArrayInGroups(['a', 'b', 'c', 'd'], 2); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.md index 6d8a9d8763..d3ef74f35e 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.md @@ -10,84 +10,85 @@ dashedName: confirm-the-ending 文字列 (最初の引数、`str`) が与えられたターゲット文字列 (2 番目の引数、`target`) で終わるかどうかを確認してください。 -このチャレンジは ES2015 で導入された `.endsWith()` メソッドを使用すれば*解決できます*。 しかし、ここでは代わりに JavaScript の substring メソッドを使用してください。 +This challenge _can_ be solved with the `.endsWith()` method, which was introduced in ES2015. しかし、ここでは代わりに JavaScript の substring メソッドを使用してください。 # --hints-- `confirmEnding("Bastian", "n")` は `true` を返す必要があります。 ```js -assert(confirmEnding('Bastian', 'n') === true); +assert.isTrue(confirmEnding('Bastian', 'n')); ``` `confirmEnding("Congratulation", "on")`は `true` を返す必要があります。 ```js -assert(confirmEnding('Congratulation', 'on') === true); +assert.isTrue(confirmEnding('Congratulation', 'on')); ``` `confirmEnding("Connor", "n")` は `false` を返す必要があります。 ```js -assert(confirmEnding('Connor', 'n') === false); +assert.isFalse(confirmEnding('Connor', 'n')); ``` `confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification")` は `false` を返す必要があります。 ```js -assert( +assert.isFalse( confirmEnding( 'Walking on water and developing software from a specification are easy if both are frozen', 'specification' - ) === false + ) ); ``` `confirmEnding("He has to give me a new name", "name")` は `true` を返す必要があります。 ```js -assert(confirmEnding('He has to give me a new name', 'name') === true); +assert.isTrue(confirmEnding('He has to give me a new name', 'name')); ``` `confirmEnding("Open sesame", "same")` は `true` を返す必要があります。 ```js -assert(confirmEnding('Open sesame', 'same') === true); +assert.isTrue(confirmEnding('Open sesame', 'same')); ``` `confirmEnding("Open sesame", "sage")` は `false` を返す必要があります。 ```js -assert(confirmEnding('Open sesame', 'sage') === false); +assert.isFalse(confirmEnding('Open sesame', 'sage')); ``` `confirmEnding("Open sesame", "game")` は `false` を返す必要があります。 ```js -assert(confirmEnding('Open sesame', 'game') === false); +assert.isFalse(confirmEnding('Open sesame', 'game')); ``` `confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain")` は `false` を返す必要があります。 ```js -assert( +assert.isFalse( confirmEnding( 'If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain' - ) === false + ) ); ``` `confirmEnding("Abstraction", "action")` は `true` を返す必要があります。 ```js -assert(confirmEnding('Abstraction', 'action') === true); +assert.isTrue(confirmEnding('Abstraction', 'action')); ``` このチャレンジを解決するプログラムでは、組み込みメソッド `.endsWith()` を使用しないでください。 ```js -assert(!/\.endsWith\(.*?\)\s*?;?/.test(__helpers.removeJSComments(code)) && !/\['endsWith'\]/.test(__helpers.removeJSComments(code))); +assert.notMatch(__helpers.removeJSComments(code), /\.endsWith\(.*?\)\s*?;?/); +assert.notMatch(__helpers.removeJSComments(code), /\['endsWith'\]/); ``` # --seed-- @@ -99,7 +100,7 @@ function confirmEnding(str, target) { return str; } -confirmEnding("Bastian", "n"); +confirmEnding('Bastian', 'n'); ``` # --solutions-- @@ -109,5 +110,5 @@ function confirmEnding(str, target) { return str.substring(str.length - target.length) === target; } -confirmEnding("Bastian", "n"); +confirmEnding('Bastian', 'n'); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md index 960e0c0c31..35df47967a 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.md @@ -17,37 +17,37 @@ dashedName: convert-celsius-to-fahrenheit `convertCtoF(0)` は数値を返す必要があります。 ```js -assert(typeof convertCtoF(0) === 'number'); +assert.isNumber(convertCtoF(0)); ``` `convertCtoF(-30)` は `-22` の値を返す必要があります。 ```js -assert(convertCtoF(-30) === -22); +assert.strictEqual(convertCtoF(-30), -22); ``` `convertCtoF(-10)` は `14` の値を返す必要があります。 ```js -assert(convertCtoF(-10) === 14); +assert.strictEqual(convertCtoF(-10), 14); ``` `convertCtoF(0)` は `32` の値を返す必要があります。 ```js -assert(convertCtoF(0) === 32); +assert.strictEqual(convertCtoF(0), 32); ``` `convertCtoF(20)` は `68` の値を返す必要があります。 ```js -assert(convertCtoF(20) === 68); +assert.strictEqual(convertCtoF(20), 68); ``` `convertCtoF(30)` は `86` の値を返す必要があります。 ```js -assert(convertCtoF(30) === 86); +assert.strictEqual(convertCtoF(30), 86); ``` # --seed-- @@ -67,7 +67,7 @@ convertCtoF(30); ```js function convertCtoF(celsius) { - let fahrenheit = celsius * 9/5 + 32; + let fahrenheit = celsius * (9 / 5) + 32; return fahrenheit; } diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md index 72bbbe1b78..31214d4db9 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.md @@ -23,31 +23,31 @@ dashedName: factorialize-a-number `factorialize(5)` は数値を返す必要があります。 ```js -assert(typeof factorialize(5) === 'number'); +assert.isNumber(factorialize(5)); ``` `factorialize(5)` は `120` を返す必要があります。 ```js -assert(factorialize(5) === 120); +assert.strictEqual(factorialize(5), 120); ``` `factorialize(10)` は `3628800` を返す必要があります。 ```js -assert(factorialize(10) === 3628800); +assert.strictEqual(factorialize(10), 3628800); ``` `factorialize(20)` は `2432902008176640000` を返す必要があります。 ```js -assert(factorialize(20) === 2432902008176640000); +assert.strictEqual(factorialize(20), 2432902008176640000); ``` `factorialize(0)` は `1` を返す必要があります。 ```js -assert(factorialize(0) === 1); +assert.strictEqual(factorialize(0), 1); ``` # --seed-- diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.md index daf90ebb34..55f74610e6 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.md @@ -45,7 +45,7 @@ assert.deepEqual(bouncer([null, NaN, 1, 2, undefined]), [1, 2]); ```js const arr = ['a', false, 0, 'Naomi']; bouncer(arr); -assert.deepEqual(arr, ['a', false, 0, 'Naomi']) +assert.deepEqual(arr, ['a', false, 0, 'Naomi']); ``` # --seed-- @@ -57,7 +57,7 @@ function bouncer(arr) { return arr; } -bouncer([7, "ate", "", false, 9]); +bouncer([7, 'ate', '', false, 9]); ``` # --solutions-- @@ -67,5 +67,5 @@ function bouncer(arr) { return arr.filter(e => e); } -bouncer([7, "ate", "", false, 9]); +bouncer([7, 'ate', '', false, 9]); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md index 6b730ae985..043dd4450e 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.md @@ -17,50 +17,51 @@ dashedName: find-the-longest-word-in-a-string `findLongestWordLength("The quick brown fox jumped over the lazy dog")` は数値を返す必要があります。 ```js -assert( - typeof findLongestWordLength( - 'The quick brown fox jumped over the lazy dog' - ) === 'number' +assert.isNumber( + findLongestWordLength('The quick brown fox jumped over the lazy dog') ); ``` `findLongestWordLength("The quick brown fox jumped over the lazy dog")` は `6` を返す必要があります。 ```js -assert( - findLongestWordLength('The quick brown fox jumped over the lazy dog') === 6 +assert.strictEqual( + findLongestWordLength('The quick brown fox jumped over the lazy dog'), + 6 ); ``` `findLongestWordLength("May the force be with you")` は `5` を返す必要があります。 ```js -assert(findLongestWordLength('May the force be with you') === 5); +assert.strictEqual(findLongestWordLength('May the force be with you'), 5); ``` `findLongestWordLength("Google do a barrel roll")` は `6` を返す必要があります。 ```js -assert(findLongestWordLength('Google do a barrel roll') === 6); +assert.strictEqual(findLongestWordLength('Google do a barrel roll'), 6); ``` `findLongestWordLength("What is the average airspeed velocity of an unladen swallow")` は `8` を返す必要があります。 ```js -assert( +assert.strictEqual( findLongestWordLength( 'What is the average airspeed velocity of an unladen swallow' - ) === 8 + ), + 8 ); ``` `findLongestWordLength("What if we try a super-long word such as otorhinolaryngology")` は `19` を返す必要があります。 ```js -assert( +assert.strictEqual( findLongestWordLength( 'What if we try a super-long word such as otorhinolaryngology' - ) === 19 + ), + 19 ); ``` @@ -73,7 +74,7 @@ function findLongestWordLength(str) { return str.length; } -findLongestWordLength("The quick brown fox jumped over the lazy dog"); +findLongestWordLength('The quick brown fox jumped over the lazy dog'); ``` # --solutions-- @@ -83,5 +84,5 @@ function findLongestWordLength(str) { return str.split(' ').sort((a, b) => b.length - a.length)[0].length; } -findLongestWordLength("The quick brown fox jumped over the lazy dog"); +findLongestWordLength('The quick brown fox jumped over the lazy dog'); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md index ad5e64adc4..8d9142f3cf 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md @@ -21,73 +21,73 @@ dashedName: mutations `mutation(["hello", "hey"])` は `false` を返す必要があります。 ```js -assert(mutation(['hello', 'hey']) === false); +assert.isFalse(mutation(['hello', 'hey'])); ``` `mutation(["hello", "Hello"])` は `true` を返す必要があります。 ```js -assert(mutation(['hello', 'Hello']) === true); +assert.isTrue(mutation(['hello', 'Hello'])); ``` `mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])` は `true` を返す必要があります。 ```js -assert(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu']) === true); +assert.isTrue(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])); ``` `mutation(["Mary", "Army"])` は `true` を返す必要があります。 ```js -assert(mutation(['Mary', 'Army']) === true); +assert.isTrue(mutation(['Mary', 'Army'])); ``` `mutation(["Mary", "Aarmy"])` は `true` を返す必要があります。 ```js -assert(mutation(['Mary', 'Aarmy']) === true); +assert.isTrue(mutation(['Mary', 'Aarmy'])); ``` `mutation(["Alien", "line"])` は `true` を返す必要があります。 ```js -assert(mutation(['Alien', 'line']) === true); +assert.isTrue(mutation(['Alien', 'line'])); ``` `mutation(["floor", "for"])` は `true` を返す必要があります。 ```js -assert(mutation(['floor', 'for']) === true); +assert.isTrue(mutation(['floor', 'for'])); ``` `mutation(["hello", "neo"])` は `false` を返す必要があります。 ```js -assert(mutation(['hello', 'neo']) === false); +assert.isFalse(mutation(['hello', 'neo'])); ``` `mutation(["voodoo", "no"])` は `false` を返す必要があります。 ```js -assert(mutation(['voodoo', 'no']) === false); +assert.isFalse(mutation(['voodoo', 'no'])); ``` `mutation(["ate", "date"])` は `false` を返す必要があります。 ```js -assert(mutation(['ate', 'date']) === false); +assert.isFalse(mutation(['ate', 'date'])); ``` `mutation(["Tiger", "Zebra"])` は `false` を返す必要があります。 ```js -assert(mutation(['Tiger', 'Zebra']) === false); +assert.isFalse(mutation(['Tiger', 'Zebra'])); ``` `mutation(["Noel", "Ole"])` は `true` を返す必要があります。 ```js -assert(mutation(['Noel', 'Ole']) === true); +assert.isTrue(mutation(['Noel', 'Ole'])); ``` # --seed-- @@ -99,7 +99,7 @@ function mutation(arr) { return arr; } -mutation(["hello", "hey"]); +mutation(['hello', 'hey']); ``` # --solutions-- @@ -108,10 +108,16 @@ mutation(["hello", "hey"]); function mutation(arr) { let hash = Object.create(null); - arr[0].toLowerCase().split('').forEach(c => hash[c] = true); + arr[0] + .toLowerCase() + .split('') + .forEach(c => (hash[c] = true)); - return !arr[1].toLowerCase().split('').filter(c => !hash[c]).length; + return !arr[1] + .toLowerCase() + .split('') + .filter(c => !hash[c]).length; } -mutation(["hello", "hey"]); +mutation(['hello', 'hey']); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md index 0a70e9cd49..82a6b6edc0 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.md @@ -8,56 +8,56 @@ dashedName: repeat-a-string-repeat-a-string # --description-- -与えられた文字列 `str` (最初の引数) を `num` (2 番目の引数) 回繰り返してください。 `num` が正の数でない場合は、空の文字列を返してください。 このチャレンジでは、組み込みメソッドの `.repeat()` は*使用しないでください *。 +与えられた文字列 `str` (最初の引数) を `num` (2 番目の引数) 回繰り返してください。 `num` が正の数でない場合は、空の文字列を返してください。 For the purpose of this challenge, do _not_ use the built-in `.repeat()` method. # --hints-- `repeatStringNumTimes("*", 3)` は文字列 `***` を返す必要があります。 ```js -assert(repeatStringNumTimes('*', 3) === '***'); +assert.strictEqual(repeatStringNumTimes('*', 3), '***'); ``` `repeatStringNumTimes("abc", 3)` は文字列 `abcabcabc` を返す必要があります。 ```js -assert(repeatStringNumTimes('abc', 3) === 'abcabcabc'); +assert.strictEqual(repeatStringNumTimes('abc', 3), 'abcabcabc'); ``` `repeatStringNumTimes("abc", 4)` は文字列 `abcabcabcabc` を返す必要があります。 ```js -assert(repeatStringNumTimes('abc', 4) === 'abcabcabcabc'); +assert.strictEqual(repeatStringNumTimes('abc', 4), 'abcabcabcabc'); ``` `repeatStringNumTimes("abc", 1)` は文字列 `abc` を返す必要があります。 ```js -assert(repeatStringNumTimes('abc', 1) === 'abc'); +assert.strictEqual(repeatStringNumTimes('abc', 1), 'abc'); ``` `repeatStringNumTimes("*", 8)` は文字列 `********` を返す必要があります。 ```js -assert(repeatStringNumTimes('*', 8) === '********'); +assert.strictEqual(repeatStringNumTimes('*', 8), '********'); ``` `repeatStringNumTimes("abc", -2)` は空の文字列 (`""`) を返す必要があります。 ```js -assert(repeatStringNumTimes('abc', -2) === ''); +assert.isEmpty(repeatStringNumTimes('abc', -2)); ``` 組み込みメソッドの `repeat()` は使用しないでください。 ```js -assert(!/\.repeat/g.test(__helpers.removeJSComments(code))); +assert.notMatch(__helpers.removeJSComments(code), /\.repeat/g); ``` `repeatStringNumTimes("abc", 0)` は `""` を返す必要があります。 ```js -assert(repeatStringNumTimes('abc', 0) === ''); +assert.isEmpty(repeatStringNumTimes('abc', 0)); ``` # --seed-- @@ -69,7 +69,7 @@ function repeatStringNumTimes(str, num) { return str; } -repeatStringNumTimes("abc", 3); +repeatStringNumTimes('abc', 3); ``` # --solutions-- @@ -77,8 +77,8 @@ repeatStringNumTimes("abc", 3); ```js function repeatStringNumTimes(str, num) { if (num < 1) return ''; - return num === 1 ? str : str + repeatStringNumTimes(str, num-1); + return num === 1 ? str : str + repeatStringNumTimes(str, num - 1); } -repeatStringNumTimes("abc", 3); +repeatStringNumTimes('abc', 3); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md index c4e14128c4..e036fa862c 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.md @@ -17,13 +17,13 @@ dashedName: return-largest-numbers-in-arrays `largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])` は配列を返す必要があります。 ```js -assert( +assert.isArray( largestOfFour([ [4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1] - ]).constructor === Array + ]) ); ``` @@ -78,7 +78,12 @@ function largestOfFour(arr) { return arr; } -largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]); +largestOfFour([ + [4, 5, 1, 3], + [13, 27, 18, 26], + [32, 35, 37, 39], + [1000, 1001, 857, 1] +]); ``` # --solutions-- @@ -88,5 +93,10 @@ function largestOfFour(arr) { return arr.map(subArr => Math.max.apply(null, subArr)); } -largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]); +largestOfFour([ + [4, 5, 1, 3], + [13, 27, 18, 26], + [32, 35, 37, 39], + [1000, 1001, 857, 1] +]); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md index 8bebfe9968..0cd3432690 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.md @@ -17,25 +17,28 @@ dashedName: reverse-a-string `reverseString("hello")` は文字列を返す必要があります。 ```js -assert(typeof reverseString('hello') === 'string'); +assert.isString(reverseString('hello')); ``` `reverseString("hello")` は文字列 `olleh` を返す必要があります。 ```js -assert(reverseString('hello') === 'olleh'); +assert.strictEqual(reverseString('hello'), 'olleh'); ``` `reverseString("Howdy")` は文字列 `ydwoH` を返す必要があります。 ```js -assert(reverseString('Howdy') === 'ydwoH'); +assert.strictEqual(reverseString('Howdy'), 'ydwoH'); ``` `reverseString("Greetings from Earth")` は文字列 `htraE morf sgniteerG` を返す必要があります。 ```js -assert(reverseString('Greetings from Earth') === 'htraE morf sgniteerG'); +assert.strictEqual( + reverseString('Greetings from Earth'), + 'htraE morf sgniteerG' +); ``` # --seed-- @@ -47,7 +50,7 @@ function reverseString(str) { return str; } -reverseString("hello"); +reverseString('hello'); ``` # --solutions-- @@ -57,5 +60,5 @@ function reverseString(str) { return str.split('').reverse().join(''); } -reverseString("hello"); +reverseString('hello'); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md index ca4edffbbc..9022e50fc7 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.md @@ -69,7 +69,7 @@ assert.deepEqual(testArr2, ['a', 'b']); ```js let testArr1 = [1, 2]; -let testArr2 = ["a", "b"]; +let testArr2 = ['a', 'b']; ``` ## --seed-contents-- @@ -89,7 +89,7 @@ function frankenSplice(arr1, arr2, n) { // It's alive. It's alive! let result = arr2.slice(); for (let i = 0; i < arr1.length; i++) { - result.splice(n+i, 0, arr1[i]); + result.splice(n + i, 0, arr1[i]); } return result; } diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.md index 756ee4542d..f3bc1c8a07 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.md @@ -17,27 +17,27 @@ dashedName: title-case-a-sentence `titleCase("I'm a little tea pot")` は文字列を返す必要があります。 ```js -assert(typeof titleCase("I'm a little tea pot") === 'string'); +assert.isString(titleCase("I'm a little tea pot")); ``` `titleCase("I'm a little tea pot")` は文字列 `I'm A Little Tea Pot` を返す必要があります。 ```js -assert(titleCase("I'm a little tea pot") === "I'm A Little Tea Pot"); +assert.strictEqual(titleCase("I'm a little tea pot"), "I'm A Little Tea Pot"); ``` `titleCase("sHoRt AnD sToUt")` は文字列 `Short And Stout` を返す必要があります。 ```js -assert(titleCase('sHoRt AnD sToUt') === 'Short And Stout'); +assert.strictEqual(titleCase('sHoRt AnD sToUt'), 'Short And Stout'); ``` `titleCase("HERE IS MY HANDLE HERE IS MY SPOUT")` は文字列 `Here Is My Handle Here Is My Spout` を返す必要があります。 ```js -assert( - titleCase('HERE IS MY HANDLE HERE IS MY SPOUT') === - 'Here Is My Handle Here Is My Spout' +assert.strictEqual( + titleCase('HERE IS MY HANDLE HERE IS MY SPOUT'), + 'Here Is My Handle Here Is My Spout' ); ``` @@ -57,7 +57,10 @@ titleCase("I'm a little tea pot"); ```js function titleCase(str) { - return str.split(' ').map(word => word.charAt(0).toUpperCase() + word.substring(1).toLowerCase()).join(' '); + return str + .split(' ') + .map(word => word.charAt(0).toUpperCase() + word.substring(1).toLowerCase()) + .join(' '); } titleCase("I'm a little tea pot"); diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md index e2ff465639..82f9a73618 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.md @@ -15,53 +15,55 @@ dashedName: truncate-a-string `truncateString("A-tisket a-tasket A green and yellow basket", 8)` は文字列 `A-tisket...` を返します。 ```js -assert( - truncateString('A-tisket a-tasket A green and yellow basket', 8) === - 'A-tisket...' +assert.strictEqual( + truncateString('A-tisket a-tasket A green and yellow basket', 8), + 'A-tisket...' ); ``` `truncateString("Peter Piper picked a peck of pickled peppers", 11)` は文字列 `Peter Piper...` を返します。 ```js -assert( - truncateString('Peter Piper picked a peck of pickled peppers', 11) === - 'Peter Piper...' +assert.strictEqual( + truncateString('Peter Piper picked a peck of pickled peppers', 11), + 'Peter Piper...' ); ``` `truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length)` は文字列 `A-tisket a-tasket A green and yellow basket` を返します。 ```js -assert( +assert.strictEqual( truncateString( 'A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length - ) === 'A-tisket a-tasket A green and yellow basket' + ), + 'A-tisket a-tasket A green and yellow basket' ); ``` `truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2)` は文字列 `A-tisket a-tasket A green and yellow basket` を返します。 ```js -assert( +assert.strictEqual( truncateString( 'A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2 - ) === 'A-tisket a-tasket A green and yellow basket' + ), + 'A-tisket a-tasket A green and yellow basket' ); ``` `truncateString("A-", 1)` は文字列 `A...` を返します。 ```js -assert(truncateString('A-', 1) === 'A...'); +assert.strictEqual(truncateString('A-', 1), 'A...'); ``` `truncateString("Absolutely Longer", 2)` は文字列 `Ab...` を返します。 ```js -assert(truncateString('Absolutely Longer', 2) === 'Ab...'); +assert.strictEqual(truncateString('Absolutely Longer', 2), 'Ab...'); ``` # --seed-- @@ -73,7 +75,7 @@ function truncateString(str, num) { return str; } -truncateString("A-tisket a-tasket A green and yellow basket", 8); +truncateString('A-tisket a-tasket A green and yellow basket', 8); ``` # --solutions-- @@ -87,5 +89,5 @@ function truncateString(str, num) { return str.slice(0, num) + '...'; } -truncateString("A-tisket a-tasket A green and yellow basket", 8); +truncateString('A-tisket a-tasket A green and yellow basket', 8); ``` diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md index 372ae2a2e5..4d97682bc2 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.md @@ -16,100 +16,100 @@ dashedName: where-do-i-belong # --hints-- -`getIndexToIns([10, 20, 30, 40, 50], 35)` は `3` を返す必要があります。 - -```js -assert(getIndexToIns([10, 20, 30, 40, 50], 35) === 3); -``` - `getIndexToIns([10, 20, 30, 40, 50], 35)` は数値を返す必要があります。 ```js -assert(typeof getIndexToIns([10, 20, 30, 40, 50], 35) === 'number'); +assert.isNumber(getIndexToIns([10, 20, 30, 40, 50], 35)); ``` -`getIndexToIns([10, 20, 30, 40, 50], 30)` は `2` を返す必要があります。 +`getIndexToIns([10, 20, 30, 40, 50], 35)` は `3` を返す必要があります。 ```js -assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2); +assert.strictEqual(getIndexToIns([10, 20, 30, 40, 50], 35), 3); ``` `getIndexToIns([10, 20, 30, 40, 50], 30)` は数値を返す必要があります。 ```js -assert(typeof getIndexToIns([10, 20, 30, 40, 50], 30) === 'number'); +assert.isNumber(getIndexToIns([10, 20, 30, 40, 50], 30)); ``` -`getIndexToIns([40, 60], 50)` は `1` を返す必要があります。 +`getIndexToIns([10, 20, 30, 40, 50], 30)` は `2` を返す必要があります。 ```js -assert(getIndexToIns([40, 60], 50) === 1); +assert.strictEqual(getIndexToIns([10, 20, 30, 40, 50], 30), 2); ``` `getIndexToIns([40, 60], 50)` は数値を返す必要があります。 ```js -assert(typeof getIndexToIns([40, 60], 50) === 'number'); +assert.isNumber(getIndexToIns([40, 60], 50)); ``` -`getIndexToIns([3, 10, 5], 3)` は `0` を返す必要があります。 +`getIndexToIns([40, 60], 50)` は `1` を返す必要があります。 ```js -assert(getIndexToIns([3, 10, 5], 3) === 0); +assert.strictEqual(getIndexToIns([40, 60], 50), 1); ``` `getIndexToIns([3, 10, 5], 3)` は数値を返す必要があります。 ```js -assert(typeof getIndexToIns([3, 10, 5], 3) === 'number'); +assert.isNumber(getIndexToIns([3, 10, 5], 3)); ``` -`getIndexToIns([5, 3, 20, 3], 5)` は `2` を返す必要があります。 +`getIndexToIns([3, 10, 5], 3)` は `0` を返す必要があります。 ```js -assert(getIndexToIns([5, 3, 20, 3], 5) === 2); +assert.strictEqual(getIndexToIns([3, 10, 5], 3), 0); ``` `getIndexToIns([5, 3, 20, 3], 5)` は数値を返す必要があります。 ```js -assert(typeof getIndexToIns([5, 3, 20, 3], 5) === 'number'); +assert.isNumber(getIndexToIns([5, 3, 20, 3], 5)); +``` + +`getIndexToIns([5, 3, 20, 3], 5)` は `2` を返す必要があります。 + +```js +assert.strictEqual(getIndexToIns([5, 3, 20, 3], 5), 2); ``` `getIndexToIns([2, 20, 10], 19)` は `2` を返す必要があります。 ```js -assert(getIndexToIns([2, 20, 10], 19) === 2); +assert.strictEqual(getIndexToIns([2, 20, 10], 19), 2); ``` `getIndexToIns([2, 20, 10], 19)` は数値を返す必要があります。 ```js -assert(typeof getIndexToIns([2, 20, 10], 19) === 'number'); +assert.isNumber(getIndexToIns([2, 20, 10], 19)); ``` `getIndexToIns([2, 5, 10], 15)` は `3` を返す必要があります。 ```js -assert(getIndexToIns([2, 5, 10], 15) === 3); +assert.strictEqual(getIndexToIns([2, 5, 10], 15), 3); ``` `getIndexToIns([2, 5, 10], 15)` は数値を返す必要があります。 ```js -assert(typeof getIndexToIns([2, 5, 10], 15) === 'number'); +assert.isNumber(getIndexToIns([2, 5, 10], 15)); ``` -`getIndexToIns([], 1)` は `0` を返す必要があります。 +`getIndexToIns([], 1)` は数値を返す必要があります。 ```js -assert(getIndexToIns([], 1) === 0); +assert.isNumber(getIndexToIns([], 1)); ``` -`getIndexToIns([], 1)` は数値を返す必要があります。 +`getIndexToIns([], 1)` は `0` を返す必要があります。 ```js -assert(typeof getIndexToIns([], 1) === 'number'); +assert.strictEqual(getIndexToIns([], 1), 0); ``` # --seed-- diff --git a/curriculum/challenges/japanese/07-scientific-computing-with-python/learn-list-comprehension-by-building-a-case-converter-program/657f456223b8c1187b461987.md b/curriculum/challenges/japanese/07-scientific-computing-with-python/learn-list-comprehension-by-building-a-case-converter-program/657f456223b8c1187b461987.md index b4043945d7..476f4ac6ea 100644 --- a/curriculum/challenges/japanese/07-scientific-computing-with-python/learn-list-comprehension-by-building-a-case-converter-program/657f456223b8c1187b461987.md +++ b/curriculum/challenges/japanese/07-scientific-computing-with-python/learn-list-comprehension-by-building-a-case-converter-program/657f456223b8c1187b461987.md @@ -50,7 +50,8 @@ Your list comprehension should evaluate `'_' + char.lower()` for each `char` in ```js ({ test: () => assert(runPython(` - _Node(_code).find_function("convert_to_snake_case").find_variable("snake_cased_char_list").find_comp_expr().is_equivalent("'_' + char.lower()") + target_var = _Node(_code).find_function("convert_to_snake_case").find_variable("snake_cased_char_list") + target_var.find_comp_expr().is_equivalent("'_' + char.lower()") and len(target_var.find_comp_ifs()) == 0 `)) }) ``` diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md index 99959b4820..489bf7a967 100644 --- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md +++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-basic-css-by-building-a-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md @@ -37,6 +37,11 @@ assert.lengthOf(document.querySelectorAll('body'), 1); assert.equal(document.querySelector('div')?.parentElement?.tagName, 'BODY'); ``` +他のすべての要素を新しい `div` の中に移動させてください。 + +```js +assert.lengthOf(document.querySelector('body > div#menu > main')?.children, 3); +``` # --seed-- diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/671141feba228a35cefba82d.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/671141feba228a35cefba82d.md index 4e47e3b9ac..b4fda8a426 100644 --- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/671141feba228a35cefba82d.md +++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/671141feba228a35cefba82d.md @@ -7,7 +7,7 @@ dashedName: step-14 # --description-- -Turn the existing text `cute cats` into an anchor element that links to `https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg`. +テキストの `cute cats` の部分を、`https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg` にリンクするアンカー要素にしてください。 # --hints-- diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-cash-register-project/build-a-cash-register.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-cash-register-project/build-a-cash-register.md index cc354a7f49..4d481a9043 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-cash-register-project/build-a-cash-register.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-cash-register-project/build-a-cash-register.md @@ -47,7 +47,7 @@ dashedName: build-a-cash-register 1. `price` が `3.26`、`#cash` の要素に入力された値が `100`、`cid` が `[["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]` の状態で、`#purchase-btn` の要素をクリックした場合、`#change-due` の要素に表示する値は `"Status: OPEN TWENTY: $60 TEN: $20 FIVE: $15 ONE: $1 QUARTER: $0.5 DIME: $0.2 PENNY: $0.04"` となります。 1. `price` が `19.5`、`#cash` の要素に入力された値が `20`、`cid` が `[["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]` の状態で、`#purchase-btn` の要素をクリックした場合、`#change-due` の要素に表示する値は `"Status: INSUFFICIENT_FUNDS"` となります。 1. `price` が `19.5`、`#cash` の要素に入力された値が `20`、`cid` が `[["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 1], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]` の状態で、`#purchase-btn` の要素をクリックした場合、`#change-due` の要素に表示する値は `"Status: INSUFFICIENT_FUNDS"` となります。 -1. When `price` is `19.5`, the value in the `#cash` element is `20`, `cid` is `[["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]`, and the `#purchase-btn` element is clicked, the value in the `#change-due` element should be `"Status: CLOSED PENNY: $0.5"`. +1. `price` が `19.5`、`#cash` の要素に入力された値が `20`、`cid` が `[["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]` の状態で、`#purchase-btn` の要素をクリックした場合、`#change-due` の要素に表示する値は `"Status: CLOSED PENNY: $0.5"` となります。 上記のユーザーストーリーを満たし、以下のすべてのテストが通るようにして、このプロジェクトを完成させてください。 あなた独自のアレンジを加えましょう。 ハッピーコーディング! @@ -111,7 +111,7 @@ cashInput.dispatchEvent(new Event('change')); purchaseBtn.click(); assert.strictEqual( alertMessage - .trim() + ?.trim() .replace(/[.,?!]+$/g, '') .toLowerCase(), 'customer does not have enough money to purchase the item' @@ -148,7 +148,7 @@ cashInput.dispatchEvent(new Event('change')); purchaseBtn.click(); assert.strictEqual( alertMessage - .trim() + ?.trim() .replace(/[.,?!]+$/g, '') .toLowerCase(), 'customer does not have enough money to purchase the item' diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-palindrome-checker-project/build-a-palindrome-checker.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-palindrome-checker-project/build-a-palindrome-checker.md index 178668a653..0e286e4295 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-palindrome-checker-project/build-a-palindrome-checker.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-palindrome-checker-project/build-a-palindrome-checker.md @@ -70,7 +70,7 @@ window.alert = (message) => alertMessage = message; // Override alert and store inputEl.value = ''; inputEl.dispatchEvent(new Event('change')) checkBtn.click(); -assert.strictEqual(alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please input a value'); +assert.strictEqual(alertMessage?.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please input a value'); ``` `#text-input` の要素に `A` という文字だけを入力した状態で `#check-btn` の要素をクリックした場合、`#result` の要素に `"A is a palindrome"` というテキストが表示されます。 diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-pokemon-search-app-project/build-a-pokemon-search-app.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-pokemon-search-app-project/build-a-pokemon-search-app.md index b7f9d8eb29..7e2424c277 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-pokemon-search-app-project/build-a-pokemon-search-app.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-pokemon-search-app-project/build-a-pokemon-search-app.md @@ -153,7 +153,7 @@ async () => { if (!res.ok) { await new Promise(resolve => setTimeout(resolve, 1000)); // Additional delay to allow the alert to trigger - assert.include(['pokémon not found', 'pokemon not found'], alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase()); + assert.include(['pokémon not found', 'pokemon not found'], alertMessage?.trim().replace(/[.,?!]+$/g, '').toLowerCase()); } } catch (err) { throw new Error(err); @@ -375,7 +375,7 @@ async () => { if (!res.ok) { await new Promise(resolve => setTimeout(resolve, 2000)); // Additional delay to allow the alert to trigger - assert.include(['pokémon not found', 'pokemon not found'], alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase()); + assert.include(['pokémon not found', 'pokemon not found'], alertMessage?.trim().replace(/[.,?!]+$/g, '').toLowerCase()); } } catch (err) { throw new Error(err); diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-telephone-number-validator-project/build-a-telephone-number-validator.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-telephone-number-validator-project/build-a-telephone-number-validator.md index be402ea555..04ae237dc4 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-telephone-number-validator-project/build-a-telephone-number-validator.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/build-a-telephone-number-validator-project/build-a-telephone-number-validator.md @@ -103,7 +103,7 @@ window.alert = (message) => alertMessage = message; // Override alert and store userInput.value = ''; checkBtn.click(); -assert.strictEqual(alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please provide a phone number'); +assert.strictEqual(alertMessage?.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please provide a phone number'); ``` `#clear-btn` の要素をクリックすると、`#results-div` の要素のコンテンツが削除されます。 diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655220a3fa5c3c200bc8e938.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655220a3fa5c3c200bc8e938.md index 15719770f1..217b53f7c6 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655220a3fa5c3c200bc8e938.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655220a3fa5c3c200bc8e938.md @@ -7,7 +7,7 @@ dashedName: step-48 # --description-- -Use `classList` and `remove()` method to remove the `playing` class from the `playButton`, since the song will be paused at this point. +曲を一時停止するので、`classList` と `remove()` メソッドを使用して、`playButton` から `playing` クラスを削除してください。 そして実際に音楽ファイルの再生を一時停止するには、変数 `audio` の `pause()` メソッドを使用してください。 `pause()` も Web Audio API のメソッドで、音声ファイルを一時停止します。 diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6552385244ccf89b77d6b332.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6552385244ccf89b77d6b332.md index a65015b0a8..be267ed2c2 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6552385244ccf89b77d6b332.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6552385244ccf89b77d6b332.md @@ -7,31 +7,31 @@ dashedName: step-52 # --description-- -You need to work on playing the next song and the previous song. For this, you will need a `playNextSong` and `playPreviousSong` function. +前後の曲の再生機能に取り掛かります。 そのためには、関数 `playNextSong` と `playPreviousSong` が必要です。 -Use `const` and arrow syntax to create an empty `playNextSong` function. +`const` とアロー構文を使用して、空の関数 `playNextSong` を作成してください。 # --hints-- -You should use `const` to create an empty function named `playNextSong`. +`const` を使用して、`playNextSong` という名前の空の関数を作成してください。 ```js assert.match(code, /const\s+playNextSong\s*=\s*/) ``` -`playNextSong` should be a function. +`playNextSong` は関数でなければなりません。 ```js assert.isFunction(playNextSong) ``` -Your `playNextSong` function should use an arrow syntax. +関数 `playNextSong` にはアロー構文を使用してください。 ```js assert.match(code, /const\s+playNextSong\s*=\s*\(\s*\)\s*=>\s*/) ``` -Your `playNextSong` function should be empty. +関数 `playNextSong` は空にしてください。 ```js assert.match(code, /const\s+playNextSong\s*=\s*\(\s*\)\s*=>\s*\{\n?\s*?\}\s*;?/) diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655243068222c2c1166b90b0.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655243068222c2c1166b90b0.md index dc249ae53a..6d4f3d0936 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655243068222c2c1166b90b0.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655243068222c2c1166b90b0.md @@ -7,19 +7,19 @@ dashedName: step-53 # --description-- -Inside the `playNextSong` function, create an `if` statement to check if the `currentSong` of `userData` is strictly equal to `null`. This will check if there's no current song playing in the `userData` object. +関数 `playNextSong` の中で、`userData` の `currentSong` が `null` と厳密に等しいかをチェックする `if` 文を作成してください。 これにより、`userData` オブジェクトに現在再生中の曲がないことを確認します。 -If the condition is true, call the `playSong` function with the `id` of the first song in the `userData?.songs` array as an argument. +条件が true の場合、配列 `userData?.songs` の最初の曲の `id` を引数として、関数 `playSong` を呼び出してください。 # --hints-- -You should not modify the existing `playNextSong` function and its content. +関数 `playNextSong` の既存のコンテンツは変更しないでください。 ```js assert.match(code, /const\s+playNextSong\s*=\s*\(\s*\)\s*=>\s*\{\s*.*\s*.*\s*.*\s*\}\s*;?/) ``` -You should create an `if` statement with the condition `userData?.currentSong === null`. +`userData?.currentSong === null` という条件を持つ `if` 文を作成してください。 ```js const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.indexOf(userData?.currentSong);') @@ -27,7 +27,7 @@ const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.i assert.match(splitter[0], /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{\s*/) ``` -You should call the `playSong` function with `userData?.songs[0].id` inside the `if` statement. +`if` 文の中で、`userData?.songs[0].id` を使用して関数 `playSong` を呼び出してください。 ```js const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.indexOf(userData?.currentSong);') diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655476e1ff522252fdcce5e4.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655476e1ff522252fdcce5e4.md index 0859b1d76c..28e41277ef 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655476e1ff522252fdcce5e4.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655476e1ff522252fdcce5e4.md @@ -7,11 +7,11 @@ dashedName: step-54 # --description-- -Add an `else` block to the `if` statement. Inside the `else` block, call the `getCurrentSongIndex()` function and assign it to a constant named `currentSongIndex`. +では、`if` 文に `else` ブロックを追加しましょう。 `else` ブロックの中で、関数 `getCurrentSongIndex()` を呼び出し、それを `currentSongIndex` という名前の定数に代入してください。 # --hints-- -You should not modify the existing `if` statement. +`if` 文の既存のコードは変更しないでください。 ```js const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.indexOf(userData?.currentSong);') @@ -19,7 +19,7 @@ const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.i assert.match(splitter[0], /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{\s*playSong\(\s*userData\?\.songs\s*\[\s*0\s*\]\s*\.id\s*\)\s*;?\s*\}/) ``` -You should add an `else` to the existing `if` statement. +既存の `if` 文に `else` を追加してください。 ```js const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.indexOf(userData?.currentSong);') diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655479aa3e1e0360ae38b7a6.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655479aa3e1e0360ae38b7a6.md index 2a52ce5ed1..415da060f8 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655479aa3e1e0360ae38b7a6.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655479aa3e1e0360ae38b7a6.md @@ -7,15 +7,15 @@ dashedName: step-55 # --description-- -Next, you will need to retrieve the next song in the playlist. For that, you will need to get the index of the current song and then add `1` to it. +次に、プレイリスト内の次の曲を取得する必要があります。 そのためには、現在の曲のインデックスを取得し、それに `1` を加えます。 -Create a constant called `nextSong` and assign `userData?.songs[currentSongIndex + 1]` to it. +では `nextSong` という定数を作成し、`userData?.songs[currentSongIndex + 1]` を代入してください。 -Lastly, call the `playSong` function and pass in `nextSong.id` as the argument. +最後に、`playSong` 関数を呼び出し、引数として `nextSong.id` を渡してください。 # --hints-- -You should not modify the existing `if` statement, its `else` block, and content. +既存の `if` 文、その `else` ブロック、および内容を変更しないでください。 ```js const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.indexOf(userData?.currentSong);') @@ -23,7 +23,7 @@ const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.i assert.match(splitter[0], /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{\s*playSong\(\s*userData\?\.songs\s*\[\s*0\s*\]\s*\.id\s*\)\s*;?\s*\}\s*else\s*\{\s*const\s+currentSongIndex\s*=\s*getCurrentSongIndex\(\s*\)\s*;?\s*/) ``` -You should assign `userData?.songs[currentSongIndex + 1]` to a `nextSong` constant. +定数 `nextSong` に `userData?.songs[currentSongIndex + 1]` を代入してください。 ```js const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.indexOf(userData?.currentSong);') @@ -31,7 +31,7 @@ const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.i assert.match(splitter[0], /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{\s*playSong\(\s*userData\?\.songs\s*\[\s*0\s*\]\s*\.id\s*\)\s*;?\s*\}\s*else\s*\{\s*const\s+currentSongIndex\s*=\s*getCurrentSongIndex\(\s*\)\s*;?\s*const\s+nextSong\s*=\s*userData\?\.songs\s*\[\s*currentSongIndex\s*\+\s*1\s*\]\s*;?\s*/) ``` -You should call the `playSong` function with `nextSong.id`. +関数 `playSong` に `nextSong.id` を渡して呼び出してください。 ```js const splitter = code.split('const getCurrentSongIndex = () => userData?.songs.indexOf(userData?.currentSong);') diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65547ee197840478a1b95f4b.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65547ee197840478a1b95f4b.md index fd57a54c97..7ab66b66cb 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65547ee197840478a1b95f4b.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65547ee197840478a1b95f4b.md @@ -7,27 +7,27 @@ dashedName: step-56 # --description-- -Now it is time to test out the `playNextSong` function. +では関数 `playNextSong` をテストしましょう。 -Add a `"click"` event listener to the `nextButton` element, then pass in `playNextSong` as the second argument of your event listener. This is the function the event listener will run. +`nextButton` の要素に `"click"` イベントリスナーを追加し、イベントリスナーの第二引数として `playNextSong` を渡してください。 これは、イベントリスナーが実行する関数です。 -Test out your app by first clicking on the play button followed by the next button. You should see that everything is working as expected. +アプリをテストするには、まず再生ボタンをクリックし、その後に次へ (Next) ボタンをクリックしてください。 すべて期待通りに動作していることが確認できるはずです。 # --hints-- -You should call the `addEventListener()` method on your `nextButton` variable. +変数 `nextButton` に対して `addEventListener()` メソッドを呼び出してください。 ```js assert.match(code, /nextButton\.addEventListener\(/) ``` -Your event listener should listen for a `"click"` event. +イベントリスナーは `"click"` イベントを監視する必要があります。 ```js assert.match(code, /nextButton\.addEventListener\(\s*('|"|`)click\1/) ``` -You should pass in `playNextSong` as the second argument of your `addEventListener` method. +`addEventListener` メソッドの第二引数として `playNextSong` を渡してください。 ```js assert.match(code, /nextButton\.addEventListener\(\s*('|"|`)click\1\s*,\s*playNextSong\s*\)/) diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6554815fe2472f8bfdab7642.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6554815fe2472f8bfdab7642.md index 2d12aeff7e..1c758f4bd4 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6554815fe2472f8bfdab7642.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/6554815fe2472f8bfdab7642.md @@ -7,29 +7,29 @@ dashedName: step-57 # --description-- -Use `const` and arrow syntax to create an empty `playPreviousSong` function. +`const` とアロー構文を使用して、空の関数 `playPreviousSong` を作成してください。 # --hints-- -You should use `const` to create an empty function named `playPreviousSong`. +`const` を使用して、`playPreviousSong` という名前の空の関数を作成してください。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*/) ``` -`playPreviousSong` should be a function. +`playPreviousSong` は関数でなければなりません。 ```js assert.isFunction(playPreviousSong) ``` -Your `playPreviousSong` function should use an arrow syntax. +関数 `playPreviousSong` にはアロー構文を使用してください。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*\(\s*\)\s*=>\s*/) ``` -Your `playPreviousSong` function should be empty. +関数 `playPreviousSong` は空にしてください。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*\(\s*\)\s*=>\s*\{\n?\s*?\}\s*;?/) diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655482742cc5499726e3f347.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655482742cc5499726e3f347.md index 5113842f3f..34ffbb00c6 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655482742cc5499726e3f347.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655482742cc5499726e3f347.md @@ -7,37 +7,37 @@ dashedName: step-58 # --description-- -Within the `playPreviousSong` function, add an `if` statement with a condition of `userData?.currentSong === null`. This will check if there is currently no song playing. If there isn't any, exit the function using a `return`. +`playPreviousSong` 関数内に、条件が `userData?.currentSong === null` の `if` 文を追加してください。 これにより、現在再生中の曲がないことを確認します。 再生中の曲がない場合は、`return` を使って関数を終了してください。 -Inside the `else` block, create a constant named `currentSongIndex` and assign it `getCurrentSongIndex()`. +`else` ブロック内で、`currentSongIndex` という名前の定数を作成し、`getCurrentSongIndex()` を代入してください。 # --hints-- -You should not alter the existing `playPreviousSong` function and its content. +`playPreviousSong` 関数の既存のコードは変更しないでください。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*\(\s*\)\s*=>\s*\{\s*/) ``` -You should have an `if` statement with the condition `userData?.currentSong === null` inside your `playPreviousSong` function. +`playPreviousSong` 関数内に、`userData?.currentSong === null` という条件の `if` 文を作成してください。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*\(\s*\)\s*=>\s*\{\s*if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{?\s*/) ``` -You should have `return` inside the block of your `if` statement. +`if` 文の中に `return` が必要です。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*\(\s*\)\s*=>\s*\{\s*if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{?\s*return\s*;?\s*\}?/) ``` -Your `if` statement should have an `else` block. +`if` 文に `else` ブロックが必要です。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*\(\s*\)\s*=>\s*\{\s*if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{?\s*return\s*;?\s*\}?\s*else\s*\{\s*/) ``` -You should call `getCurrentSongIndex` and assign it to `currentSongIndex` inside the `else` block of your `if` statement. +`if` 文の `else` ブロックの中で `getCurrentSongIndex` を呼び出して、`currentSongIndex` に代入してください。 ```js assert.match(code, /const\s+playPreviousSong\s*=\s*\(\s*\)\s*=>\s*\{\s*if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{?\s*return\s*;?\s*\}?\s*else\s*\{\s*const\s+currentSongIndex\s*=\s*getCurrentSongIndex\(\s*\)\s*;?\s*/) diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655483ebf0096ba02b2c3d4c.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655483ebf0096ba02b2c3d4c.md index c3261b0625..99d507d2f3 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655483ebf0096ba02b2c3d4c.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655483ebf0096ba02b2c3d4c.md @@ -7,23 +7,23 @@ dashedName: step-59 # --description-- -To get the previous song, subtract `1` from the `currentSongIndex` of `userData?.songs` and assign it to the constant `previousSong`. After that, call the `playSong` function and pass `previousSong.id` as an argument. +前の曲を取得するため、`currentSongIndex` から `1` を引いたインデックスを使用して `userData?.songs` にアクセスし、定数 `previousSong` に代入してください。 その後、`previousSong.id` を引数として渡して `playSong` 関数を呼び出してください。 # --hints-- -You should not modify the existing `if` statement and its content. +`if` 文の既存のコードは変更しないでください。 ```js assert.match(code, /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{?\s*return\s*;?\s*\}?\s*else\s*\{\s*const\s+currentSongIndex\s*=\s*getCurrentSongIndex\(\s*\)\s*;?\s*/) ``` -You should assign `userData?.songs[currentSongIndex - 1]` to a `previousSong` constant. +定数 `previousSong` に `userData?.songs[currentSongIndex - 1]` を代入してください。 ```js assert.match(code, /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{?\s*return\s*;?\s*\}?\s*else\s*\{\s*const\s+currentSongIndex\s*=\s*getCurrentSongIndex\(\s*\)\s*;?\s*const\s+previousSong\s*=\s*userData\?\.songs\s*\[\s*currentSongIndex\s*-\s*1\s*\]\s*;?\s*/) ``` -You should call the `playSong` function with `previousSong.id`. +関数 `playSong` に `previousSong.id` を渡して呼び出してください。 ```js assert.match(code, /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{?\s*return\s*;?\s*\}?\s*else\s*\{\s*const\s+currentSongIndex\s*=\s*getCurrentSongIndex\(\s*\)\s*;?\s*const\s+previousSong\s*=\s*userData\?\.songs\s*\[\s*currentSongIndex\s*-\s*1\s*\]\s*;?\s*playSong\(\s*previousSong\.id\s*\)\s*;?\s*\}/) diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655487f686aabfc2a10ba887.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655487f686aabfc2a10ba887.md index efb6ddea2f..f501709085 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655487f686aabfc2a10ba887.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/655487f686aabfc2a10ba887.md @@ -7,19 +7,19 @@ dashedName: step-50 # --description-- -Before you start working on playing the next and previous song, you need to get the index of each song in the `songs` property of `userData`. +前後の曲の再生機能に取り掛かる前に、`userData` の `songs` プロパティからそれぞれの曲のインデックスを取得できるようにします。 -Start by creating an arrow function called `getCurrentSongIndex`. +まず、`getCurrentSongIndex` という名前のアロー関数を作成してください。 # --hints-- -You should have a `getCurrentSongIndex` function. +関数 `getCurrentSongIndex` を作成してください。 ```js assert.isFunction(getCurrentSongIndex); ``` -Your `getCurrentSongIndex` function should use arrow syntax. +関数 `getCurrentSongIndex` はアロー構文を使用する必要があります。 ```js assert.match(code, /(let|const)\s+getCurrentSongIndex\s*=\s*\(\s*\)\s*=>\s*{\s*}\s*/); diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/659b0093d7db5a1a1122b7bd.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/659b0093d7db5a1a1122b7bd.md index c3e5cc174c..f525e2b2aa 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/659b0093d7db5a1a1122b7bd.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/659b0093d7db5a1a1122b7bd.md @@ -7,24 +7,24 @@ dashedName: step-51 # --description-- -To get the index for the current song, you can use the <dfn>indexOf()</dfn> method. The `indexOf()` array method returns the first index at which a given element can be found in the array, or `-1` if the element is not present. +現在の曲のインデックスを取得するには、<dfn>indexOf()</dfn> メソッドを使用します。 配列メソッド `indexOf()` は、指定された要素が配列内で最初に見つかったインデックスを返し、該当する要素が存在しない場合は `-1` を返します。 ```js const animals = ["dog", "cat", "horse"]; animals.indexOf("cat") // 1 ``` -Inside your `getCurrentSongIndex` function, return `userData?.songs.indexOf()`. For the `indexOf()` argument, set it to `userData?.currentSong`. +では `getCurrentSongIndex` 関数内で、`userData?.songs.indexOf()` を返してください。 `indexOf()` の引数には `userData?.currentSong` を使用してください。 # --hints-- -You should return `userData?.songs.indexOf()` inside your `getCurrentSongIndex` function. +`getCurrentSongIndex` 関数内で、`userData?.songs.indexOf()` を返してください。 ```js assert.match(code, /const\s+getCurrentSongIndex\s*=\s*\(\s*\)\s*=>(\s*userData\?\.songs\.indexOf\(|\s*{\s*return?\s+userData\?\.songs\.indexOf\()/) ``` -You should pass in `userData?.currentSong` into the `indexOf()` method. +`indexOf()` メソッドに `userData?.currentSong` を渡してください。 ```js assert.match(code, /const\s+getCurrentSongIndex\s*=\s*\(\s*\)\s*=>(\s*userData\?\.songs\.indexOf\(\s*userData\?\.currentSong\s*\)\s*;?|\s*{\s*return\s+userData\?\.songs\.indexOf\(\s*userData\?\.currentSong\s*\)\s*;?\s*})/) diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md index 4ba44c09ec..efff95e2c1 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md @@ -9,7 +9,7 @@ dashedName: step-103 Inside your condition, add a `forEach` loop to iterate through the `checkpoints` array. Use `checkpoint` as the parameter name for the callback function. -Inside the loop, use the subtraction assignment operator to subtract 5 from the checkpoints's `x` position. +Inside the `forEach` callback, use the subtraction assignment operator to subtract 5 from the checkpoints's `x` position. # --hints-- @@ -24,7 +24,7 @@ You should have a `checkpoint` parameter inside the `forEach` callback function. ```js const splitter = code.split("if (keys.rightKey.pressed && isCheckpointCollisionDetectionActive)") -assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{/); +assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{?/); ``` You should use the subtraction assignment operator to subtract 5 from the `checkpoint`'s `x` position. diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md index d302e40151..97457e7a84 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md @@ -9,7 +9,7 @@ dashedName: step-104 Inside your `else if` statement, add a `forEach` loop to iterate through the `checkpoints` array. Use `checkpoint` as the parameter name for the callback function. -Inside the loop, use the addition assignment operator to add 5 to the checkpoints's `x` position. +Inside the `forEach` callback, use the addition assignment operator to add 5 to the checkpoints's `x` position. # --hints-- @@ -24,7 +24,7 @@ You should use the `checkpoint` parameter inside the `forEach` callback function ```js const splitter = code.split("else if (keys.leftKey.pressed && isCheckpointCollisionDetectionActive) {") -assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{/); +assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{?/); ``` You should use the addition assignment operator to add 5 to the `checkpoint`'s `x` position. diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md index 6155d9957d..e40e08c4cc 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ dashedName: step-24 `task` というクラスを持つ `div` 要素を作成する必要があります。 ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` `div` 要素が `${id}` という `id` を持つようにしてください。 ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md index abf8212ba5..c28f0a11fd 100644 --- a/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md +++ b/curriculum/challenges/japanese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md @@ -31,7 +31,7 @@ window.alert = (message) => alertMessage = message; // Override alert and store numberInput.value = ''; checkUserInput(); -assert.strictEqual(alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please provide a decimal number greater than or equal to 0'); +assert.strictEqual(alertMessage?.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please provide a decimal number greater than or equal to 0'); ``` # --seed-- diff --git a/curriculum/challenges/japanese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md b/curriculum/challenges/japanese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md index 56e36bc224..1aefa78ac6 100644 --- a/curriculum/challenges/japanese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md +++ b/curriculum/challenges/japanese/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md @@ -14,7 +14,9 @@ dashedName: word-problems \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">『Business Math, a Step-by-Step Handbook (2021)』、Jean-Paul Oliver著</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">『Algebra and Trigonometry』、Jay Abramson著</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/japanese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md b/curriculum/challenges/japanese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md index 369198f796..0b3fe6f5c2 100644 --- a/curriculum/challenges/japanese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md +++ b/curriculum/challenges/japanese/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md @@ -14,7 +14,9 @@ dashedName: introduction-to-college-algebra-with-python \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">『Business Math, a Step-by-Step Handbook (2021)』、Jean-Paul Oliver著</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">『Algebra and Trigonometry』、Jay Abramson著</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66b56d36cc47571a0e2a3dc5.md b/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66b56d36cc47571a0e2a3dc5.md index d2df5dc405..34c586a251 100644 --- a/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66b56d36cc47571a0e2a3dc5.md +++ b/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66b56d36cc47571a0e2a3dc5.md @@ -32,7 +32,7 @@ This answer doesn't have anything to do with the dialogue. Focus on answers that ## --video-solution-- -2 +1 # --explanation-- diff --git a/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66bbc147bc59c25e60e18aec.md b/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66bbc147bc59c25e60e18aec.md index f2f4e253a6..26b9c70e81 100644 --- a/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66bbc147bc59c25e60e18aec.md +++ b/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66bbc147bc59c25e60e18aec.md @@ -48,7 +48,7 @@ If it were working correctly, Tom wouldn't say that it isn't showing. ## --video-solution-- -2 +3 # --explanation-- diff --git a/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md b/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md index dc90df92b0..d62e911d9d 100644 --- a/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md +++ b/curriculum/challenges/japanese/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md @@ -40,7 +40,7 @@ Because the IDEs are not installed correctly. ### --feedback-- -TOm is not frustrated about instalation. +Tom is not frustrated about installation. --- diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-book-catalog-table/66ec4c8e9878d8441956516f.md b/curriculum/challenges/japanese/25-front-end-development/lab-book-catalog-table/66ec4c8e9878d8441956516f.md index 3df5417ebd..63709d96e7 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-book-catalog-table/66ec4c8e9878d8441956516f.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-book-catalog-table/66ec4c8e9878d8441956516f.md @@ -18,7 +18,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab 1. Your table should have a table body element with at least five rows in it. 1. Each row in your table body should have four table data elements that display the book's Title, Author, Genre, and Publication Year. 1. Your table should have a table footer element with one row in it. -1. The row in your table footer element should have a table data element that spans four columns and has the text `Total Books: [number of books in your table]`. +1. The row in your table footer element should have a table data element that spans four columns and has the text `Total Books: N` where `N` should be replaced by the number of books in your table. # --hints-- diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md b/curriculum/challenges/japanese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md index 63067388df..41ad8bf7a8 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md @@ -14,7 +14,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab **ユーザーストーリー:** -1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, the `getBookmarks` function should return an empty array. +1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, or it doesn't contain a valid array with bookmarks, the `getBookmarks` function should return an empty array. 1. The `bookmarks` key stored in the local storage should be an array of bookmark objects. Each bookmark object should have three keys: `name`, `category`, and `url`. 1. You should have a function named `displayOrCloseForm` that toggles the `hidden` class on `#main-section` and `#form-section`. 1. When you click `#add-bookmark-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown` and call `displayOrCloseForm` to display the form section and hide the main section. @@ -24,10 +24,10 @@ Fulfill the user stories below and get all the tests to pass to complete the lab 1. You should have a function named `displayOrHideCategory` that toggles the `hidden` class on `#main-section` and `#bookmark-list-section`. 1. When you click `#view-category-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown`, modify the inner HTML of `#category-list` according to the user stories below, and call the `displayOrHideCategory` function. 1. If none of the bookmarks in local storage have the category, you should set the inner HTML of the `#category-list` to a `p` element with the text `No Bookmarks Found`. -1. If one or more bookmarks in local storage have the selected category you should add a radio button with `id` and `value` attributes set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. +1. If one or more bookmarks in local storage have the selected category, you should add a radio button with `id` and `value` attributes, and set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. Additionally, each radio button should have the same `name` attribute. 1. Each radio button should have a corresponding label containing an anchor element with the bookmark name and the `href` attribute set to the bookmark URL. -1. When you click `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. -1. When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +1. When you click the `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. +1. When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. # --hints-- @@ -69,6 +69,24 @@ try { } ``` +When the `bookmarks` key in the `localStorage` does not contain a valid array of bookmark objects, the `getBookmarks` function should return an empty array. + +```js +try { + localStorage.setItem("bookmarks", 'invalid'); + const arrayFromInvalidValue = getBookmarks(); + assert.isArray(arrayFromInvalidValue); + assert.isEmpty(arrayFromInvalidValue); + + localStorage.setItem("bookmarks", JSON.stringify([{name: "example1", category: "news", notUrl: "example1.com"}])); + const arrayFromInvalidArray = getBookmarks(); + assert.isArray(arrayFromInvalidArray) + assert.isEmpty(arrayFromInvalidArray) +} finally { + resetLocalStorage(); +} +``` + You should have a function named `displayOrCloseForm`. ```js @@ -201,7 +219,7 @@ try { } ``` -When you click `#view-category-button`, you should modify `#category-list`'s inner HTML by adding a radio button having the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. +When you click the `#view-category-button`, you should modify the `#category-list` element's inner HTML by adding a radio button. The radio button should have the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. Additionally, each radio button should have the same `name` attribute. ```js try { @@ -214,6 +232,8 @@ try { assert.strictEqual(bookmarksDisplayed[0].value, "example1"); assert.strictEqual(bookmarksDisplayed[1].id, "example4"); assert.strictEqual(bookmarksDisplayed[1].value, "example4"); + assert.isOk(bookmarksDisplayed[0].name) + assert.strictEqual(bookmarksDisplayed[0].name, bookmarksDisplayed[1].name); } finally { resetLocalStorage(); } @@ -262,7 +282,49 @@ closeListButtonTest.dispatchEvent(new Event("click")); assert.strictEqual(getHidden("bookmark list"), "bookmark list"); ``` -When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +When you click the `#close-list-button` and then open any category, the `#category-list` should contain only data relevant for the selected category, without duplicating entries. + +```js +setLocalStorage(); +try { + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const categoryList = document.getElementById("category-list").innerHTML; + assert.strictEqual(categoryList, "<p>No Bookmarks Found</p>"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "news"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const newsBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(newsBookmarks, 2); + assert.strictEqual(newsBookmarks[0].id, "example1"); + assert.strictEqual(newsBookmarks[0].value, "example1"); + assert.strictEqual(newsBookmarks[1].id, "example4"); + assert.strictEqual(newsBookmarks[1].value, "example4"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "work"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const workBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(workBookmarks, 1); + assert.strictEqual(workBookmarks[0].id, "example3"); + assert.strictEqual(workBookmarks[0].value, "example3"); + + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const paragraphs = document.querySelectorAll("#category-list p"); + assert.lengthOf(paragraphs, 1); + assert.strictEqual(paragraphs[0].innerText, "No Bookmarks Found"); +} finally { + resetLocalStorage(); + clearCategoryList(); +} +``` + +When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. ```js setLocalStorage(); @@ -282,6 +344,16 @@ try { const expected = [{name: "example2", category: "entertainment", url: "example2.com"}, {name: "example3", category: "work", url: "example3.com"}, {name: "example4", category: "news", url: "example4.com"}]; assert.deepEqual(getBookmarks(), expected); + localStorage.setItem("bookmarks", JSON.stringify([{name: "duplicated-name", category: "news", url: "example1.com"}, {name: "duplicated-name", category: "entertainment", url: "example2.com"}])); + + categoryDropdownTest.value = "entertainment"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const radioForDuplicate = document.querySelector('#category-list input[type="radio"]'); + radioForDuplicate.checked = true; + + deleteBookmarkButtonTest.dispatchEvent(new Event("click")); + + assert.deepEqual(getBookmarks(), [{name: "duplicated-name", category: "news", url: "example1.com"}]) } finally { resetLocalStorage(); } @@ -529,7 +601,26 @@ const addBookmarkButtonForm = document.getElementById("add-bookmark-button-form" const categoryList = document.getElementById("category-list"); const closeListButton = document.getElementById("close-list-button"); const deleteBookmarkButton = document.getElementById("delete-bookmark-button"); -const getBookmarks = () => JSON.parse(localStorage.getItem("bookmarks")) || []; + +const getBookmarks = () => { + try { + const parsed = JSON.parse(localStorage.getItem("bookmarks")); + if ( + Array.isArray(parsed) && + parsed.every( + (item) => + item.hasOwnProperty("category") && + item.hasOwnProperty("name") && + item.hasOwnProperty("url"), + ) + ) { + return parsed; + } + return []; + } catch { + return []; + } +}; const displayOrCloseForm = () => { mainSection.classList.toggle("hidden"); @@ -570,12 +661,7 @@ const displayOrHideCategory = () => { const fillBookmarkList = () => { categoryHeading[1].innerText = categoryDropdown.value.charAt(0).toUpperCase() + categoryDropdown.value.slice(1); - const bookmarksToDisplay = getBookmarks().filter((i) => { - if (i.category === categoryDropdown.value) { - return true - } - return false - }); + const bookmarksToDisplay = getBookmarks().filter((i) => i.category === categoryDropdown.value); if (bookmarksToDisplay.length) { categoryList.innerHTML = ''; for (const bookmark of bookmarksToDisplay) { @@ -604,7 +690,7 @@ const deleteBookmark = () => { for (const radioBookmark of radioBookmarks) { if (radioBookmark.checked) { const bookmarks = getBookmarks(); - const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value); + const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value && i.category === categoryDropdown.value); bookmarks.splice(indexToRemove, 1); localStorage.setItem("bookmarks", JSON.stringify(bookmarks)); return diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-event-hub/66ebd4ae2812430bb883c787.md b/curriculum/challenges/japanese/25-front-end-development/lab-event-hub/66ebd4ae2812430bb883c787.md index 6f7ddffd70..5599d44a95 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-event-hub/66ebd4ae2812430bb883c787.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-event-hub/66ebd4ae2812430bb883c787.md @@ -92,7 +92,7 @@ const secondLink = document.querySelectorAll('header nav ul li a')[1]; assert.exists(secondLink); ``` -The text of the first item in the unordered list should be `"Upcoming Events"`. +The text of the first item in the unordered list should be `Upcoming Events`. ```js const firstLink = document.querySelectorAll('header nav>ul>li>a')[0]; @@ -107,6 +107,13 @@ const hrefAttribute = anchorElement?.getAttribute("href"); assert.strictEqual(hrefAttribute, "#upcoming-events"); ``` +The text of the second item in the unordered list should be `Past Events`. + +```js +const secondLink = document.querySelectorAll('header nav>ul>li>a')[1]; +assert.strictEqual(secondLink.innerText, "Past Events"); +``` + The second item in the unordered list should have the `href` set to `#past-events`. ```js @@ -230,6 +237,22 @@ for (let img of imgElements) { } ``` +Each `h3` element should have the event title. + +```js +const eventTitles = document.querySelectorAll('h3'); +assert.isNotEmpty(eventTitles); +eventTitles.forEach((eventTitle => assert.isNotEmpty(eventTitle.innerText))); +``` + +Each `p` element shoud have the event description. + +```js +const eventDescriptions = document.querySelectorAll('p'); +assert.isNotEmpty(eventDescriptions); +eventDescriptions.forEach((eventDescription => assert.isNotEmpty(eventDescription.innerText))); +``` + # --seed-- ## --seed-contents-- diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md b/curriculum/challenges/japanese/25-front-end-development/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md index 00a64aaa75..5f19dbd8d0 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md @@ -72,20 +72,18 @@ You should use `let` to declare a new variable `codingFact`. ```js const codeWithoutComments = __helpers.removeJSComments(code); -const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*("|').+?\2\s*\+\s*favoriteLanguage/g) assert.match(code, /let\s+codingFact/) -assert.include(first, 'let'); -assert.exists(first); ``` You should give `codingFact` a value that includes `favoriteLanguage` using concatenation. ```js const codeWithoutComments = __helpers.removeJSComments(code); -const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*("|').+?\2\s*\+\s*favoriteLanguage/g) -assert.match(code, /let\scodingFact\s*=\s*("|').+?\1\s*\+\s*favoriteLanguage/) +const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*("|')?.+?\2?\s*\+\s*favoriteLanguage/g) +assert.match(code, /let\scodingFact\s*=\s*("|')?.+?\1?\s*\+\s*favoriteLanguage/) assert.include(first, 'let'); assert.exists(first); +assert.isNotEmpty(codingFact); ``` You should log `codingFact` to the console. @@ -102,11 +100,12 @@ You should assign a new value to `codingFact` that also contains `favoriteLangua ```js const codeWithoutComments = __helpers.removeJSComments(code); const loggingCodingFacts = codeWithoutComments.match(/console\.log\(\s*codingFact\s*\)/g) -const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*("|').+?\2\s*\+\s*favoriteLanguage/g) +const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*("|')?.+?\2?\s*\+\s*favoriteLanguage/g) assert.include(output[4], favoriteLanguage); assert.notEqual(output[4], output[3]); assert.isAtLeast(loggingCodingFacts.length, 2); assert.exists(second); +assert.isNotEmpty(codingFact); ``` You should assign a value to `codingFact` for the third time that also contains `favoriteLanguage`, and log it to the console. @@ -114,12 +113,13 @@ You should assign a value to `codingFact` for the third time that also contains ```js const codeWithoutComments = __helpers.removeJSComments(code); const loggingCodingFacts = codeWithoutComments.match(/console\.log\(\s*codingFact\s*\)/g) -const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*("|').+?\2\s*\+\s*favoriteLanguage/g) +const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*("|')?.+?\2?\s*\+\s*favoriteLanguage/g) assert.include(output[5], favoriteLanguage); assert.notEqual(output[5], output[4]); assert.equal(output[5], codingFact); assert.lengthOf(loggingCodingFacts, 3); assert.exists(third); +assert.isNotEmpty(codingFact); ``` You should log to the console `"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)."` using concatenation to add the values of the variables. diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md b/curriculum/challenges/japanese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md index fba79087f2..b14acff58a 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md @@ -58,6 +58,12 @@ With `2024` as the value of the `year` variable, the `result` should be `2024 is assert.strictEqual(isLeapYear(2024), '2024 is a leap year.'); ``` +With `2000` as the value of the `year` variable, the `result` should be `2000 is a leap year.`. + +```js +assert.strictEqual(isLeapYear(2000), '2000 is a leap year.'); +``` + With `1900` as the value of the `year` variable, the `result` should be `1900 is not a leap year.`. ```js @@ -74,7 +80,7 @@ assert.match(__helpers.removeJSComments(code), /isLeapYear\(\s*year\s*\)/); You should store the result of calling the `isLeapYear` function in a variable named `result`. ```js -assert.match(__helpers.removeJSComments(code), /const\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); +assert.match(__helpers.removeJSComments(code), /(?:var|let|const)\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); ``` You should output the `result` to the console using `console.log()`. diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-markdown-to-html-converter/66f55eac933ff64ce654ca74.md b/curriculum/challenges/japanese/25-front-end-development/lab-markdown-to-html-converter/66f55eac933ff64ce654ca74.md index b877f975f7..7adc23cacf 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-markdown-to-html-converter/66f55eac933ff64ce654ca74.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-markdown-to-html-converter/66f55eac933ff64ce654ca74.md @@ -134,6 +134,20 @@ const testH1 = testDiv.querySelector("h1") assert.notExists(testH1); ``` +When the value of `#markdown-input` is `# title 1\n# alternate title`, `convertMarkdown()` should return `<h1>title 1</h1><h1>alternate title</h1>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "# title 1\n# alternate title"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const headings = testDiv.querySelectorAll("h1"); +assert.lengthOf(headings, 2); +assert.lengthOf(testDiv.children, 2); +assert.equal(headings[0].innerText, "title 1"); +assert.equal(headings[1].innerText, "alternate title"); +``` + When the value of `#markdown-input` is `## title 2`, `convertMarkdown()` should return `<h2>title 2</h2>`. ```js @@ -186,6 +200,20 @@ const testH2 = testDiv.querySelector("h2") assert.notExists(testH2); ``` +When the value of `#markdown-input` is `## title 2\n## title 2 alt`, `convertMarkdown()` should return `<h2>title 2</h2><h2>title 2 alt</h2>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "## title 2\n## title 2 alt"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const headings = testDiv.querySelectorAll("h2"); +assert.lengthOf(headings, 2); +assert.lengthOf(testDiv.children, 2); +assert.equal(headings[0].innerText, "title 2"); +assert.equal(headings[1].innerText, "title 2 alt"); +``` + When the value of `#markdown-input` is `### title 3`, `convertMarkdown()` should return `<h3>title 3</h3>`. ```js @@ -238,6 +266,20 @@ const testH3 = testDiv.querySelector("h3") assert.notExists(testH3); ``` +When the value of `#markdown-input` is `### title 3\n### third title`, `convertMarkdown()` should return `<h3>title 3</h3><h3>third title</h3>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "### title 3\n### third title"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const headings = testDiv.querySelectorAll("h3"); +assert.lengthOf(headings, 2); +assert.lengthOf(testDiv.children, 2); +assert.equal(headings[0].innerText, "title 3"); +assert.equal(headings[1].innerText, "third title"); +``` + When the value of `#markdown-input` is `**this is bold**`, `convertMarkdown()` should return `<strong>this is bold</strong>`. ```js @@ -279,17 +321,18 @@ assert.lengthOf(preview.children, 1) assert.equal(strongs[0].innerText, "this is bold"); ``` -When the value of `#markdown-input` is `__this is bold__`, `convertMarkdown()` should return `<strong>this is bold</strong>`. +When the value of `#markdown-input` is `**this is bold**\n**this is also bold**`, `convertMarkdown()` should return `<strong>this is bold</strong><strong>this is also bold</strong>`. ```js const input = document.querySelector("#markdown-input"); -input.value = "__this is bold__"; +input.value = "**this is bold**\n**this is also bold**"; const testDiv = document.createElement("div"); testDiv.innerHTML = convertMarkdown(); const strongs = testDiv.querySelectorAll("strong"); -assert.lengthOf(strongs, 1); -assert.lengthOf(testDiv.children, 1); +assert.lengthOf(strongs, 2); +assert.lengthOf(testDiv.children, 2); assert.equal(strongs[0].innerText, "this is bold"); +assert.equal(strongs[1].innerText, "this is also bold"); ``` When the value of `#markdown-input` is `__this is bold__`, `<strong>this is bold</strong>` should be displayed inside `#html-output`. @@ -320,6 +363,20 @@ assert.lengthOf(preview.children, 1) assert.equal(strongs[0].innerText, "this is bold"); ``` +When the value of `#markdown-input` is `__this is bold__\n__this is also bold__`, `convertMarkdown()` should return `<strong>this is bold</strong><strong>this is also bold</strong>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "__this is bold__\n__this is also bold__"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const strongs = testDiv.querySelectorAll("strong"); +assert.lengthOf(strongs, 2); +assert.lengthOf(testDiv.children, 2); +assert.equal(strongs[0].innerText, "this is bold"); +assert.equal(strongs[1].innerText, "this is also bold"); +``` + When the value of `#markdown-input` is `*this is italic*`, `convertMarkdown()` should return `<em>this is italic</em>`. ```js @@ -361,6 +418,20 @@ assert.lengthOf(preview.children, 1); assert.equal(italics[0].innerText, "this is italic"); ``` +When the value of `#markdown-input` is `*this is italic*\n*this is also italic*`, `convertMarkdown()` should return `<em>this is italic</em><em>this is also italic</em>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "*this is italic*\n*this is also italic*"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const italics = testDiv.querySelectorAll("em"); +assert.lengthOf(italics, 2); +assert.lengthOf(testDiv.children, 2); +assert.equal(italics[0].innerText, "this is italic"); +assert.equal(italics[1].innerText, "this is also italic"); +``` + When the value of `#markdown-input` is `_this is italic_`, `convertMarkdown()` should return `<em>this is italic</em>`. ```js @@ -402,6 +473,20 @@ assert.lengthOf(preview.children, 1); assert.equal(italics[0].innerText, "this is italic"); ``` +When the value of `#markdown-input` is `_this is italic_\n_this is also italic_`, `convertMarkdown()` should return `<em>this is italic</em><em>this is also italic</em>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "_this is italic_\n_this is also italic_"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const italics = testDiv.querySelectorAll("em"); +assert.lengthOf(italics, 2); +assert.lengthOf(testDiv.children, 2); +assert.equal(italics[0].innerText, "this is italic"); +assert.equal(italics[1].innerText, "this is also italic"); +``` + When the value of `#markdown-input` is either `# **title 1**` or `# __title 1__`, `convertMarkdown()` should return `<h1><strong>title 1</strong></h1>`. ```js @@ -529,6 +614,22 @@ assert.equal(imgs[0].alt, "alt-text"); assert.isTrue(imgs[0].src.endsWith("image-source")); ``` +When the value of `#markdown-input` is `\n`, `convertMarkdown()` should return `<img alt="alt-text" src="image-source"><img alt="alt-text-2" src="image-source-2">`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "!\n"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const imgs = testDiv.querySelectorAll("img"); +assert.lengthOf(testDiv.children, 2); +assert.lengthOf(imgs, 2); +assert.equal(imgs[0].alt, "alt-text"); +assert.isTrue(imgs[0].src.endsWith("image-source")); +assert.equal(imgs[1].alt, "alt-text-2"); +assert.isTrue(imgs[1].src.endsWith("image-source-2")); +``` + When the value of `#markdown-input` is `[link text](URL)`, `convertMarkdown()` should return `<a href="URL">link text</a>`. ```js @@ -573,6 +674,22 @@ assert.isTrue(anchors[0].href.endsWith("URL")); assert.equal(anchors[0].innerText, "link text"); ``` +When the value of `#markdown-input` is `[link text](URL)\n[link text 2](URL2)`, `convertMarkdown()` should return `<a href="URL">link text</a><a href="URL2">link text 2</a>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "[link text](URL)\n[link text 2](URL2)"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const anchors = testDiv.querySelectorAll("a"); +assert.lengthOf(testDiv.children, 2); +assert.lengthOf(anchors, 2); +assert.isTrue(anchors[0].href.endsWith("URL")); +assert.equal(anchors[0].innerText, "link text"); +assert.isTrue(anchors[1].href.endsWith("URL2")); +assert.equal(anchors[1].innerText, "link text 2"); +``` + When the value of `#markdown-input` is `> this is a quote`, `convertMarkdown()` should return `<blockquote>this is a quote</blockquote>`. ```js @@ -614,6 +731,21 @@ assert.lengthOf(quotes, 1); assert.equal(quotes[0].innerText, "this is a quote"); ``` +When the value of `#markdown-input` is `> this is a quote\n> this is another quote`, `convertMarkdown()` should return `<blockquote>this is a quote</blockquote><blockquote>this is another quote</blockquote>`. + +```js +const input = document.querySelector("#markdown-input"); +input.value = "> this is a quote\n> this is another quote"; +const testDiv = document.createElement("div"); +testDiv.innerHTML = convertMarkdown(); +const quotes = testDiv.querySelectorAll("blockquote"); +assert.lengthOf(testDiv.children, 2); +assert.lengthOf(quotes, 2); +assert.equal(quotes[0].innerText, "this is a quote"); +assert.equal(quotes[1].innerText, "this is another quote"); +``` + + When the value of `#markdown-input` is `some text > not a quote anymore`, `convertMarkdown()` should not convert `> not a quote anymore` into a `blockquote` element. ```js diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-palindrome-checker/657bdc55a322aae1eac3838f.md b/curriculum/challenges/japanese/25-front-end-development/lab-palindrome-checker/657bdc55a322aae1eac3838f.md index b3bcbf3be2..25943ba1a2 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-palindrome-checker/657bdc55a322aae1eac3838f.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-palindrome-checker/657bdc55a322aae1eac3838f.md @@ -68,7 +68,7 @@ window.alert = (message) => alertMessage = message; // Override alert and store inputEl.value = ''; inputEl.dispatchEvent(new Event('change')) checkBtn.click(); -assert.strictEqual(alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please input a value'); +assert.strictEqual(alertMessage?.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please input a value'); ``` When the `#text-input` element only contains the letter `A` and the `#check-btn` element is clicked, the `#result` element should contain the text `"A is a palindrome"`. diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-project-idea-board/67051431a73f1ca25d9a6f25.md b/curriculum/challenges/japanese/25-front-end-development/lab-project-idea-board/67051431a73f1ca25d9a6f25.md index 493cc70725..6175babe4c 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-project-idea-board/67051431a73f1ca25d9a6f25.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-project-idea-board/67051431a73f1ca25d9a6f25.md @@ -215,7 +215,7 @@ techProjects.unpin(smartHome); assert.isEmpty(techProjects.ideas); ``` -When `new ProjectIdeaBoard("Empty Board")` is empty, `emptyBoard.formatToString()` should return `Empty Board has 0 ideas\n`. +When `new ProjectIdeaBoard("Empty Board")` is empty, `emptyBoard.formatToString()` should return `Empty Board has 0 idea(s)\n`. ```js diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md b/curriculum/challenges/japanese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md index 12f6557f80..f4e5ee21cc 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md @@ -159,13 +159,13 @@ for (let e of listItems) { The anchor element of your first list item should wrap the text `Group Travels`. ```js -assert.equal(document.querySelectorAll('a')[0]?.innerText, 'Group Travels'); +assert.equal(document.querySelectorAll('li > a')[0]?.innerText, 'Group Travels'); ``` The anchor element of your second list item should wrap the text `Private Tours`. ```js -assert.equal(document.querySelectorAll('a')[1]?.innerText, 'Private Tours'); +assert.equal(document.querySelectorAll('li > a')[1]?.innerText, 'Private Tours'); ``` You should have an `h2` element after your unordered list. @@ -233,7 +233,7 @@ Each `img` element should have a valid `src` attribute. const images = document.querySelectorAll('img'); assert.isNotEmpty(images); for (let image of images) { - assert.isAbove(image.src.length, 0); + assert.isAbove(image.src.trim().length, 0); } ``` @@ -243,7 +243,7 @@ Each `img` element should have an `alt` attribute with an appropriate value. const images = document.querySelectorAll('img'); assert.isNotEmpty(images); for (let image of images) { - assert.isAbove(image.alt.length, 0); + assert.isAbove(image.alt.trim().length, 0); } ``` diff --git a/curriculum/challenges/japanese/25-front-end-development/lab-video-compilation-page/669e81368e52b3a5c35a2dc5.md b/curriculum/challenges/japanese/25-front-end-development/lab-video-compilation-page/669e81368e52b3a5c35a2dc5.md index 6248694fd2..df6b1d8ef3 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lab-video-compilation-page/669e81368e52b3a5c35a2dc5.md +++ b/curriculum/challenges/japanese/25-front-end-development/lab-video-compilation-page/669e81368e52b3a5c35a2dc5.md @@ -13,10 +13,11 @@ Fulfill the user stories below and get all the tests to pass to complete the lab **ユーザーストーリー:** -1. You should have a `main` element. +1. You should have a `main` element as the only child of the `body` element. 1. You should have an `h1` element with the topic of your page. 1. You should have a paragraph introducing the topic of your page below your `h1` element. -1. You should have three `section` elements, each containing an `h2` element, a paragraph, and an `iframe` element. +1. You should have three `section` elements below your first paragraph. +1. Each section should contain an `h2` element, a paragraph, and an `iframe` element, in this order. 1. The three `iframe` elements should have a `src` attribute set to a valid video. 1. Each `iframe` element should also have a `title` attribute to describe the embedded content, and a `height` attribute and a `width` attribute to set the element to a proper size. diff --git a/curriculum/challenges/japanese/25-front-end-development/lecture-importance-of-semantic-html/672995ffdfd2f337f5f215f8.md b/curriculum/challenges/japanese/25-front-end-development/lecture-importance-of-semantic-html/672995ffdfd2f337f5f215f8.md index 59beabf4e9..1ecd98c26e 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lecture-importance-of-semantic-html/672995ffdfd2f337f5f215f8.md +++ b/curriculum/challenges/japanese/25-front-end-development/lecture-importance-of-semantic-html/672995ffdfd2f337f5f215f8.md @@ -34,7 +34,7 @@ Review the beginning of the video where the `superscript` element is discussed. --- -To display text as a `superscript` above the normal line of text. +To display text as a superscript above the normal line of text. --- diff --git a/curriculum/challenges/japanese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md b/curriculum/challenges/japanese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md index cfa1be8adc..08fe131107 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md +++ b/curriculum/challenges/japanese/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md @@ -86,36 +86,36 @@ All of the above. ## --text-- -What is the recommended strategy for pacing yourself through the freeCodeCamp certification coursework? +What makes each freeCodeCamp certification unique? ## --answers-- -Code for several hours one day a week. +It has its own unique verification URL. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Code for half an hour every day. - ---- - -Complete all coursework in one month. +It has its own unique serial number. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Work only on weekends. +It has its own QR code. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. + +--- + +All of the above. ## --video-solution-- -2 +4 diff --git a/curriculum/challenges/japanese/25-front-end-development/lecture-what-is-html/66f6db08d55022680a3cfbc9.md b/curriculum/challenges/japanese/25-front-end-development/lecture-what-is-html/66f6db08d55022680a3cfbc9.md index 184b714b4c..bf1a439064 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lecture-what-is-html/66f6db08d55022680a3cfbc9.md +++ b/curriculum/challenges/japanese/25-front-end-development/lecture-what-is-html/66f6db08d55022680a3cfbc9.md @@ -22,7 +22,7 @@ HyperText Maker Language ### --feedback-- -Focus on the term for describing the structure and presentation of web pages. +Review the first ten seconds of the lecture video where this was discussed. --- @@ -30,7 +30,7 @@ HyperText Marker Language ### --feedback-- -Focus on the term for describing the structure and presentation of web pages. +Review the first ten seconds of the lecture video where this was discussed. --- @@ -38,7 +38,7 @@ HyperText Markdown Language ### --feedback-- -Focus on the term for describing the structure and presentation of web pages. +Review the first ten seconds of the lecture video where this was discussed. --- diff --git a/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md b/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md index bbd535265b..c5d6ecb6eb 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md +++ b/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md @@ -2,7 +2,7 @@ id: 672d269da46786225e3fe3fd title: What Is the Purpose of Functions, and How Do They Work? challengeType: 11 -videoId: sU2mIGNjBtc +videoId: maLeO3YCqxs dashedName: what-is-the-purpose-of-functions-and-how-do-they-work --- diff --git a/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md b/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md index d9f2af9f09..9999634949 100644 --- a/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md +++ b/curriculum/challenges/japanese/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md @@ -86,7 +86,7 @@ Remember, you can pass a second argument to the method to control where the sear ## --text-- -What type of function is `indexOf` in JavaScript? +What type of method is `indexOf` in JavaScript? ## --answers-- @@ -94,15 +94,15 @@ A standalone function. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- -A method of the `Array` object. +A method of the `Date` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- @@ -110,11 +110,11 @@ A method of the `String` object. --- -A mathematical function. +A method of the `Math` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. ## --video-solution-- diff --git a/curriculum/challenges/japanese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md b/curriculum/challenges/japanese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md index 0f867d3ad9..090bfa7177 100644 --- a/curriculum/challenges/japanese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md +++ b/curriculum/challenges/japanese/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md @@ -215,7 +215,7 @@ Which selector is correct to target the next sibling of an `img`? #### --text-- -Which selector is correct to target all siblings of an `img`? +Which selector is correct to target all siblings preceded by an `img` element? #### --distractors-- @@ -307,19 +307,19 @@ Given the following selectors, which has the lowest specificity? #### --distractors-- -`h1` +`#id` --- -`#id` +`.class` --- -`p` +`div h1` #### --answer-- -`div` +`h1` ### --question-- diff --git a/curriculum/challenges/japanese/25-front-end-development/quiz-css-colors/66ed8fe1f45ce3ece4053eb1.md b/curriculum/challenges/japanese/25-front-end-development/quiz-css-colors/66ed8fe1f45ce3ece4053eb1.md index 1c191914a8..911dd9f72d 100644 --- a/curriculum/challenges/japanese/25-front-end-development/quiz-css-colors/66ed8fe1f45ce3ece4053eb1.md +++ b/curriculum/challenges/japanese/25-front-end-development/quiz-css-colors/66ed8fe1f45ce3ece4053eb1.md @@ -205,11 +205,11 @@ Which of these functions allows specifying the transparency of a color? --- -`rgba()` +`alpha()` #### --answer-- -`opacity()` +`rgba()` ### --question-- @@ -419,7 +419,7 @@ Which of the following is the correct syntax to create a CSS variable with a fal ```css .element { - color: var(--main-color, red); + color: var(--main-color; red); } ``` diff --git a/curriculum/challenges/japanese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md b/curriculum/challenges/japanese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md index 6c8140bf6d..45ba4f942a 100644 --- a/curriculum/challenges/japanese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md +++ b/curriculum/challenges/japanese/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md @@ -171,7 +171,7 @@ It allows you to use custom fonts by importing them #### --text-- -Which service offers a large selection of free fonts for use on websites? +Which service offers a large selection of free fonts that can be easily integrated directly into websites? #### --distractors-- @@ -183,7 +183,7 @@ Adobe Fonts --- -Font Squirrel +Font Universe #### --answer-- diff --git a/curriculum/challenges/japanese/25-front-end-development/quiz-design-fundamentals/66ed901ff45ce3ece4053eba.md b/curriculum/challenges/japanese/25-front-end-development/quiz-design-fundamentals/66ed901ff45ce3ece4053eba.md index e3ab555833..c687e078a1 100644 --- a/curriculum/challenges/japanese/25-front-end-development/quiz-design-fundamentals/66ed901ff45ce3ece4053eba.md +++ b/curriculum/challenges/japanese/25-front-end-development/quiz-design-fundamentals/66ed901ff45ce3ece4053eba.md @@ -69,7 +69,7 @@ A single-page portfolio site. --- -A complex e-commerce site with multiple categories and subcategories. +An infinite scroll gallery site. --- diff --git a/curriculum/challenges/japanese/25-front-end-development/review-javascript-functional-programming/6723d2c154dd19d0025f7cd9.md b/curriculum/challenges/japanese/25-front-end-development/review-javascript-functional-programming/6723d2c154dd19d0025f7cd9.md index 2f77b05e5b..87c236a90f 100644 --- a/curriculum/challenges/japanese/25-front-end-development/review-javascript-functional-programming/6723d2c154dd19d0025f7cd9.md +++ b/curriculum/challenges/japanese/25-front-end-development/review-javascript-functional-programming/6723d2c154dd19d0025f7cd9.md @@ -24,7 +24,7 @@ Review the concepts below to prepare for the upcoming quiz. - Currying is a functional programming technique that transforms a function with multiple arguments into a sequence of functions, each taking a single argument. -Here is an example of a regualr function vs a curried function: +Here is an example of a regular function vs a curried function: ```js // Regular function diff --git a/curriculum/challenges/japanese/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md b/curriculum/challenges/japanese/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md index 3343a69ca7..6e9e133430 100644 --- a/curriculum/challenges/japanese/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md +++ b/curriculum/challenges/japanese/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md @@ -2611,7 +2611,7 @@ In the above example, the `findFactorial` function is called recursively until ` - Currying is a functional programming technique that transforms a function with multiple arguments into a sequence of functions, each taking a single argument. -Here is an example of a regualr function vs a curried function: +Here is an example of a regular function vs a curried function: ```js // Regular function diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md b/curriculum/challenges/japanese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md index f380801677..50f47395ba 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md @@ -9,7 +9,7 @@ dashedName: step-8 For your blog, there should be a way for users to navigate to different sections on the page. -The `nav` element is used to to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. +The `nav` element is used to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. Here is an example of using the `nav` element: diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md b/curriculum/challenges/japanese/25-front-end-development/workshop-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md index 3e41cc028f..daa0120929 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-cafe-menu/5f356ed6cf6eab5f15f5cfe6.md @@ -37,6 +37,11 @@ assert.lengthOf(document.querySelectorAll('body'), 1); assert.equal(document.querySelector('div')?.parentElement?.tagName, 'BODY'); ``` +You should move all the other elements inside the new `div`. + +```js +assert.lengthOf(document.querySelector('body > div#menu > main')?.children, 3); +``` # --seed-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-calculator/66cc0a9e06e00b75d6782be9.md b/curriculum/challenges/japanese/25-front-end-development/workshop-calculator/66cc0a9e06e00b75d6782be9.md index 598833581a..05982c28be 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-calculator/66cc0a9e06e00b75d6782be9.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-calculator/66cc0a9e06e00b75d6782be9.md @@ -13,7 +13,7 @@ Here is a reminder of how to call a function: ```js function myFunction() { - return 'Hello World'; + return "Hello World"; } // function call diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md b/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md index 06b4be5a16..0b98e7082b 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/64475c0b61cddb6feaab4e2e.md @@ -31,7 +31,7 @@ window.alert = (message) => alertMessage = message; // Override alert and store numberInput.value = ''; checkUserInput(); -assert.strictEqual(alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please provide a decimal number greater than or equal to 0'); +assert.strictEqual(alertMessage?.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please provide a decimal number greater than or equal to 0'); ``` # --seed-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/6464b1384318a5087190950a.md b/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/6464b1384318a5087190950a.md index 36568bfc1d..1bcc7a9900 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/6464b1384318a5087190950a.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-decimal-to-binary-converter/6464b1384318a5087190950a.md @@ -9,7 +9,7 @@ dashedName: step-104 Now that you've targeted the correct element, you can update its text after the delay you specified earlier. -Using the `.getElementById()` method, set the `textContent` property of the targeted element equal to the `msg` property of the current object. +Set the `textContent` property of the targeted element equal to the `msg` property of the current object by using property chaining on your `.getElementById()` method directly. # --hints-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md index b361646a43..031bdfa2f0 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md @@ -8,7 +8,7 @@ demoType: onLoad # --description-- -In this workshop, you will learn how to work with HTML tables by building a final exam table for a group of students. +In this workshop, you will practice working with HTML tables by building a final exam table for a group of students. To begin the project, add the `<!DOCTYPE html>`, and an `html` element with a `lang` attribute of `en`. diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md index 751f59aeb6..276d47803a 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md @@ -29,7 +29,7 @@ Your `table` element should be inside your `body` element. ```js const tableEl = document.querySelector('table'); -assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); +assert.strictEqual(tableEl?.parentElement?.tagName, 'BODY'); ``` # --seed-- @@ -44,9 +44,9 @@ assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); <meta charset="UTF-8" /> </head> <body> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </body> </html> ``` diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md index 0a98113e24..efdbefb5e0 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -To add a caption to a `table`, you can use the table <dfn>caption</dfn> element. +To add a caption to a `table`, you can use the <dfn>table caption</dfn> element. Here is an example using the `caption` element: diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md index 71fbf97fdb..74f7895ced 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md @@ -9,7 +9,7 @@ dashedName: step-5 For the first section of the table, you will want to group the header content which represents the column labels for the student's first name, last name, and final exam grade. -The `table head` element, `<thead>`, is used to group the header content in a table. +The <dfn>table head</dfn> element, `thead`, is used to group the header content in a table. Here is an example using the `thead` element: @@ -21,7 +21,7 @@ Here is an example using the `thead` element: </table> ``` -Below your `caption` element, add a `table head` element. +Below your `caption` element, add a table head element. # --hints-- @@ -41,7 +41,7 @@ Your `thead` element should be inside your `table` element. ```js const theadEl = document.querySelector('thead'); -assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); +assert.strictEqual(theadEl?.parentElement?.tagName, 'TABLE'); ``` # --seed-- @@ -60,9 +60,9 @@ assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); <caption> Calculus Final Exam Grades </caption> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md index 88b5767875..976d9c792c 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -The `table head` element consists of a `table row` element, `<tr>`, which contains the `table header` cell elements, `<th>`. +The table head element consists of a <dfn>table row</dfn> element, `tr`, which contains the <dfn>table header cell</dfn> elements, `th`. Here is an example using the `tr` and `th` elements for a sports table: @@ -48,28 +48,28 @@ Your `tr` element should be inside your `thead` element. ```js const trEl = document.querySelector('tr'); -assert.strictEqual(trEl.parentElement.tagName, 'THEAD'); +assert.strictEqual(trEl?.parentElement?.tagName, 'THEAD'); ``` Your first `th` element should have the text of `Last Name`. ```js const thEl = document.querySelectorAll('th')[0]; -assert.strictEqual(thEl.textContent, 'Last Name'); +assert.strictEqual(thEl?.textContent, 'Last Name'); ``` Your second `th` element should have the text of `First Name`. ```js const thEl = document.querySelectorAll('th')[1]; -assert.strictEqual(thEl.textContent, 'First Name'); +assert.strictEqual(thEl?.textContent, 'First Name'); ``` Your third `th` element should have the text of `Grade`. ```js const thEl = document.querySelectorAll('th')[2]; -assert.strictEqual(thEl.textContent, 'Grade'); +assert.strictEqual(thEl?.textContent, 'Grade'); ``` All of your `th` elements should be inside your `tr` element. diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md index 46a118f177..e4a9cf8293 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md @@ -7,9 +7,9 @@ dashedName: step-7 # --description-- -Now that you have completed the head section, it is time to add the `table body`. The `table body` will represent all of the student names and their grades. +Now that you have completed the head section, it is time to add the <dfn>table body</dfn>, `tbody`. The table body will represent all of the student names and their grades. -Add a `table body` element to your table. +Add a table body element to your table. # --hints-- @@ -55,10 +55,9 @@ assert.match(code, /<tbody>[\s\S]*<\/tbody>/i); <th>Grade</th> </tr> </thead> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md index 0f3cb05746..471704c14c 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md @@ -7,9 +7,9 @@ dashedName: step-8 # --description-- -To add student data to the table, you will need to use the `table row` and <dfn>table data</dfn> elements. +To add student data to the table, you will need to use the table row and table data elements. -The `table data` element, `<td>`, is used to create a cell in the table. +The <dfn>table data</dfn> element, `td`, is used to create a cell in the table. Here is an example of using the `td` element for a sports players table: @@ -21,29 +21,17 @@ Here is an example of using the `td` element for a sports players table: </tr> ``` -Inside your `table body` element, add a `table row` element, `<tr>`, with three `table data` elements, `<td>`. +Inside your table body element, add a table row element, `tr`, with three table data elements, `td`. -The first `table data` element should contain the last name of `Davis`. +The first table data element should contain the last name of `Davis`. -The second `table data` element should contain the first name of `Alex`. +The second table data element should contain the first name of `Alex`. -The third `table data` element should contain the grade of `54`. +The third table data element should contain the grade of `54`. # --hints-- -You should have an opening `tr` tag. - -```js -assert.match(code, /<tr>/i); -``` - -You should have a closing `tr` tag. - -```js -assert.match(code, /<\/tr>/i); -``` - -Your `tr` element should be inside your `tbody` element. +You should have a `tr` element inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr')); @@ -52,19 +40,19 @@ assert.isNotNull(document.querySelector('tbody tr')); You should have a `td` element with the text `Davis` inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr td').textContent, 'Davis'); +assert.strictEqual(document.querySelector('tbody tr td')?.textContent, 'Davis'); ``` You should have a `td` element with the text `Alex` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[1].textContent, 'Alex'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[1]?.textContent, 'Alex'); ``` You should have a `td` element with the text `54` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[2].textContent, '54'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[2]?.textContent, '54'); ``` You should have all three of the `td` elements inside the `tr` element. @@ -99,9 +87,9 @@ assert.match(code, /<tr>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*< </thead> <tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md index 668a6e848a..34b8bec8da 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md @@ -9,13 +9,13 @@ dashedName: step-9 Now it is time to add two more students to the table. -Following the same pattern as the previous step, add a second student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous step, add a second student table row. Use the following data for the table data elements: - Last Name: `Doe` - First Name: `Samantha` - Grade: `92` -For the third student `table row`, use the following data for the `table data` elements: +For the third student table row, use the following data for the table data elements: - Last Name: `Rodriguez` - First Name: `Marcus` @@ -23,7 +23,7 @@ For the third student `table row`, use the following data for the `table data` e # --hints-- -You should have a second `table row` inside your `tbody` element. +You should have a second `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); You should have a `td` element with the text `Doe` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child').textContent, 'Doe'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child')?.textContent, 'Doe'); ``` You should have a `td` element with the text `Samantha` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)').textContent, 'Samantha'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)')?.textContent, 'Samantha'); ``` You should have a `td` element with the text `92` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child').textContent, '92'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child')?.textContent, '92'); ``` -You should have a third `table row` inside your `tbody` element. +You should have a third `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); You should have a `td` element with the text `Rodriguez` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child').textContent, 'Rodriguez'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child')?.textContent, 'Rodriguez'); ``` You should have a `td` element with the text `Marcus` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)').textContent, 'Marcus'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)')?.textContent, 'Marcus'); ``` You should have a `td` element with the text `88` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child').textContent, '88'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child')?.textContent, '88'); ``` # --seed-- @@ -102,10 +102,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child <td>Alex</td> <td>54</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md index eabfaf6abd..f2cdac4725 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md @@ -9,13 +9,13 @@ dashedName: step-10 Now it is time to add two more students to the table. -Following the same pattern as the previous steps, add a fourth student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous steps, add a fourth student table row. Use the following data for the table data elements: - Last Name: `Thompson` - First Name: `Jane` - Grade: `77` -For the fifth student `table row`, use the following data for the `table data` elements: +For the fifth student table row, use the following data for the table data elements: - Last Name: `Williams` - First Name: `Natalie` @@ -23,7 +23,7 @@ For the fifth student `table row`, use the following data for the `table data` e # --hints-- -You should have a fourth `table row` inside your `tbody` element. +You should have a fourth `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); You should have a `td` element with the text `Thompson` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child').textContent, 'Thompson'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child')?.textContent, 'Thompson'); ``` You should have a `td` element with the text `Jane` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)').textContent, 'Jane'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)')?.textContent, 'Jane'); ``` You should have a `td` element with the text `77` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)').textContent, '77'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)')?.textContent, '77'); ``` -You should have a fifth `table row` inside your `tbody` element. +You should have a fifth `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); You should have a `td` element with the text `Williams` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child').textContent, 'Williams'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child')?.textContent, 'Williams'); ``` You should have a `td` element with the text `Natalie` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)').textContent, 'Natalie'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)')?.textContent, 'Natalie'); ``` You should have a `td` element with the text `83` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)').textContent, '83'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)')?.textContent, '83'); ``` # --seed-- @@ -114,10 +114,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-typ <td>Marcus</td> <td>88</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md index 64814f395f..23c03033e9 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -The last section to add to the table would be the `table foot` (`<tfoot>`) element. The `table foot` element will be used to display the average grade for all of the students in the table. +The last section to add to the table would be the <dfn>table foot</dfn> element, `tfoot`. The table foot element will be used to display the average grade for all of the students in the table. Add a `tfoot` element to the table. @@ -40,13 +40,13 @@ assert.isNotNull(document.querySelector('tfoot tr')); Your first `td` element should contain the text `Average Grade`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:first-child').textContent, 'Average Grade'); +assert.strictEqual(document.querySelector('tfoot tr td:first-child')?.textContent, 'Average Grade'); ``` Your second `td` element should contain the text `78.8`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)').textContent, '78.8'); +assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)')?.textContent, '78.8'); ``` Your `tr` element should have two `td` elements inside it. @@ -111,9 +111,9 @@ assert.strictEqual(document.querySelectorAll('tfoot tr td').length, 2); <td>83</td> </tr> </tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a84111965a0c46df6bbd0a.md b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a84111965a0c46df6bbd0a.md index 399f9ea5d1..394d705c14 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a84111965a0c46df6bbd0a.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-hotel-feedback-form/66a84111965a0c46df6bbd0a.md @@ -18,7 +18,7 @@ The `for` attribute on the `label` element should match the `id` attribute on th Below your `legend` element, add a `label` element with the text of `Name (required):`. For the `for` attribute, set it to the value of `"full-name"`. -Then below your `legend` element, add an `input` element with no attributes. In the next steps, you will add the necessary attributes. +Then below your `label` element, add an `input` element with no attributes. In the next steps, you will add the necessary attributes. # --hints-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5630.md b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5630.md index a010c6c140..408895d618 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5630.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5630.md @@ -13,30 +13,76 @@ You should now push the three objects into the `recipes` array. To do thus, you Use the `push()` method to push all the recipe objects into the `recipes` array. Make sure to push `recipe1`, `recipe2`, and `recipe3` in that order. +Also delete the `recipe1Name`, `recipe2Name`, `recipe1CookingTime`, and `recipe2CookingTime` variables, and the `console.log` statements which log those variables. + # --hints-- -You should remove `recipe1Name` and its console log. +You should remove the `recipe1Name` variable. + +```js +try { + recipe1Name; + assert.fail('Variable is defined/declared'); +} catch (e) { + assert.include(e?.message, 'recipe1Name is not defined'); +} +``` + +You should remove the `console.log(recipe1Name);` statement. + +```js +assert.notMatch(__helpers.removeJSComments(code), /console\s*\.\s*log\s*\(\s*recipe1Name\s*\)\s*;?/); +``` + +You should remove the `recipe2Name` variable. + +```js +try { + recipe2Name; + assert.fail('Variable is defined/declared'); +} catch (e) { + assert.include(e?.message, 'recipe2Name is not defined'); +} +``` + +You should remove the `console.log(recipe2Name);` statement. + +```js +assert.notMatch(__helpers.removeJSComments(code), /console\s*\.\s*log\s*\(\s*recipe2Name\s*\)\s*;?/); +``` + +You should remove the `recipe1CookingTime` variable. ```js -assert.notMatch(code, /const\s*recipe1Name\s*=\s*recipe1\.name;?\s*console\.log\(recipe1Name\);?/) +try { + recipe1CookingTime; + assert.fail('Variable is defined/declared'); +} catch (e) { + assert.include(e?.message, 'recipe1CookingTime is not defined'); +} ``` -You should remove `recipe2Name` and its console log. +You should remove the `console.log(recipe1CookingTime);` statement. ```js -assert.notMatch(code, /const\s*recipe2Name\s*=\s*recipe2\.name;?\s*console\.log\(recipe2Name\);?/) +assert.notMatch(__helpers.removeJSComments(code), /console\s*\.\s*log\s*\(\s*recipe1CookingTime\s*\)\s*;?/); ``` -You should remove `recipe1CookingTime` and its console log. +You should remove the `recipe2CookingTime` variable. ```js -assert.notMatch(code, /const\s*recipe1CookingTime\s*=\s*recipe1\.cookingTime;?\s*console\.log\(recipe1CookingTime\);?/) +try { + recipe2CookingTime; + assert.fail('Variable is defined/declared'); +} catch (e) { + assert.include(e?.message, 'recipe2CookingTime is not defined'); +} ``` -You should remove `recipe2CookingTime` and its console log. +You should remove the `console.log(recipe2CookingTime);` statement. ```js -assert.notMatch(code, /const\s*recipe2CookingTime\s*=\s*recipe2\.cookingTime;?\s*console\.log\(recipe2CookingTime\);?/) +assert.notMatch(__helpers.removeJSComments(code), /console\s*\.\s*log\s*\(\s*recipe2CookingTime\s*\)\s*;?/); ``` You should push all the recipes objects into the `recipes` array. Make sure to push them in the order they are declared. diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5631.md b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5631.md index 292feedbae..6ca14f2a2a 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5631.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5631.md @@ -9,7 +9,7 @@ dashedName: step-7 Now, you should work on calculating the `averageRating`, `totalIngredients`, and the `difficultyLevel` for each recipe in the `recipes` array. -Start by creating a `getAverageRating` function that takes a `ratings` parameter. Inside the function, calculate the average rating using the items in the `ratings` property of each recipe. +Start by creating a `getAverageRating` function that takes a single argument, which is an array with ratings. Inside the function, calculate the average rating from the array passed to the function. Your `getAverageRating` function must return a number. @@ -21,10 +21,10 @@ You should create a `getAverageRating` function. assert.isFunction(getAverageRating) ``` -Your `getAverageRating` function should have a `ratings` parameter. +Your `getAverageRating` function should have a single parameter. ```js -assert.match(getAverageRating.toString(), /ratings/); +assert.lengthOf(getAverageRating, 1); ``` Your `getAverageRating` function should return a number. @@ -33,30 +33,22 @@ Your `getAverageRating` function should return a number. assert.isNumber(getAverageRating(recipe1.ratings)) ``` -You `getAverageRating` function should return a number when the average rating is `4.00`. +`getAverageRating(recipe1.ratings)` should return `4.5`. ```js -assert.isNumber(getAverageRating(recipe2.ratings)) +assert.strictEqual(getAverageRating(recipe1.ratings), 4.5) ``` -You `getAverageRating` function should return a number when the average rating is `4.75`. +`getAverageRating(recipe2.ratings)` should return `4.75`. ```js -assert.isNumber(getAverageRating(recipe2.ratings)) +assert.strictEqual(getAverageRating(recipe2.ratings), 4.75) ``` -You `getAverageRating` function should return a number when the average rating is `4.50`. +`getAverageRating(recipe3.ratings)` should return `4`. ```js -assert.isNumber(getAverageRating(recipe1.ratings)) -``` - -Your `getAverageRating` function should return the correct rating. - -```js -assert.equal(getAverageRating(recipe1.ratings), 4.50) -assert.equal(getAverageRating(recipe2.ratings), 4.75) -assert.equal(getAverageRating(recipe3.ratings), 4.00) +assert.strictEqual(getAverageRating(recipe3.ratings), 4) ``` # --seed-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5632.md b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5632.md index ace358ab7f..6d190332d1 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5632.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5632.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -Create a `getTotalIngredients` function that takes an `ingredients` parameter. This function should return the number of ingredients for each recipe by returning the length of the `ingredients` array. +Create a `getTotalIngredients` function that takes a single argument, representing an array with ingredients, and returns the number of ingredients from the array passed to the function. # --hints-- @@ -17,10 +17,10 @@ You should create a `getTotalIngredients` function. assert.isFunction(getTotalIngredients) ``` -You `getTotalIngredients` function should have an `ingredients` parameter. +Your `getTotalIngredients` function should have a single parameter. ```js -assert.match(getTotalIngredients.toString(), /ingredients/); +assert.lengthOf(getTotalIngredients, 1); ``` Your `getTotalIngredients` function should return a number. @@ -29,30 +29,22 @@ Your `getTotalIngredients` function should return a number. assert.isNumber(getTotalIngredients(recipe1.ingredients)) ``` -Your `getTotalIngredients` function should return a number when the total ingrendients is `5`. +`getTotalIngredients(recipe1.ingredients)` should return `4`. ```js -assert.isNumber(getTotalIngredients(recipe2.ingredients)) +assert.strictEqual(getTotalIngredients(recipe1.ingredients), 4); ``` -Your `getTotalIngredients` function should return a number when the total ingrendients is `3`. +`getTotalIngredients(recipe2.ingredients)` should return `5`. ```js -assert.isNumber(getTotalIngredients(recipe3.ingredients)) +assert.strictEqual(getTotalIngredients(recipe2.ingredients), 5); ``` -Your `getTotalIngredients` function should return a number when the total ingrendients is `4`. +`getTotalIngredients(recipe3.ingredients)` should return `3`. ```js -assert.isNumber(getTotalIngredients(recipe1.ingredients)) -``` - -Your `getTotalIngredients` function should return the correct number of ingredients. - -```js -assert.equal(getTotalIngredients(recipe1.ingredients), 4) -assert.equal(getTotalIngredients(recipe2.ingredients), 5) -assert.equal(getTotalIngredients(recipe3.ingredients), 3) +assert.strictEqual(getTotalIngredients(recipe3.ingredients), 3); ``` # --seed-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5633.md b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5633.md index c686ff0e9a..7056df9e9b 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5633.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5633.md @@ -7,9 +7,9 @@ dashedName: step-9 # --description-- -Create a `getDifficultyLevel` function that takes `cookingTime` as a parameter. +Create a `getDifficultyLevel` function that takes a number indicating the cooking time as a parameter. -If `cookingTime` is less than `30`, the function should return `"easy"`. If it is less than or equal to `60`, the function should return `"medium"`. Otherwise, the function should return `"hard"`. +If the cooking time is less than or equal to `30`, the function should return `"easy"`. If it is less than or equal to `60`, the function should return `"medium"`. Otherwise, the function should return `"hard"`. # --hints-- @@ -19,13 +19,13 @@ You should create a `getDifficultyLevel` function. assert.isFunction(getDifficultyLevel) ``` -You `getDifficultyLevel` function should have a `cookingTime` parameter. +Your `getDifficultyLevel` function should have a single parameter. ```js -assert.match(getDifficultyLevel.toString(), /cookingTime/); +assert.lengthOf(getDifficultyLevel, 1); ``` -Your `getDifficultyLevel` function should return `"easy"` when the `cookingTime` is less than or equal to `30`. +Your `getDifficultyLevel` function should return `"easy"` when the cooking time is less than or equal to `30`. ```js assert.strictEqual(getDifficultyLevel(10), "easy") @@ -34,7 +34,7 @@ assert.strictEqual(getDifficultyLevel(29), "easy") assert.strictEqual(getDifficultyLevel(30), "easy") ``` -Your `getDifficultyLevel` function should return `"medium"` when the `cookingTime` is greater than `31` and less than `60`. +Your `getDifficultyLevel` function should return `"medium"` when the cooking time is greater than `31` and less than or equal to `60`. ```js assert.strictEqual(getDifficultyLevel(31), "medium") @@ -43,7 +43,7 @@ assert.strictEqual(getDifficultyLevel(50), "medium") assert.strictEqual(getDifficultyLevel(60), "medium") ``` -Your `getDifficultyLevel` function should return `"hard"` when the `cookingTime` is greater than `60`. +Your `getDifficultyLevel` function should return `"hard"` when the cooking time is greater than `60`. ```js assert.strictEqual(getDifficultyLevel(61), "hard") diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5635.md b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5635.md index 3a34c4658f..48de895967 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5635.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5635.md @@ -9,46 +9,44 @@ dashedName: step-11 You can now fill in each item of the `recipes` array with values for the `averageRating`, `totalIngredients`, and `difficultyLevel` properties. -To do this, access the `averageRating`, `totalIngredients`, and `difficultyLevel` properties of each recipe object and assign them the results of the corresponding function calls with the appropriate arguments. - -For now, access the `averageRating`, `totalIngredients`, and `difficultyLevel` of `recipe1` and set them to the appropriate function calls and arguments. +For now, access the `averageRating`, `totalIngredients`, and `difficultyLevel` of `recipe1` and set them to the appropriate results of function calls and arguments. # --hints-- You should access the `averageRating` property of `recipe1`. ```js -assert.match(code, /recipe1\.averageRating/) +assert.isNotNull(recipe1.averageRating); ``` -You should set the `averageRating` of `recipe1` you accessed to the calling of `getAverageRating` with `recipe1.ratings` as its parameter. +You should assign the result of calling `getAverageRating` with `recipe1.ratings` to the `averageRating` property of `recipe1`. ```js -assert.match(code, /recipe1\.averageRating\s*=\s*getAverageRating\(recipe1\.ratings\);?/) +assert.strictEqual(recipe1.averageRating, getAverageRating(recipe1.ratings)); ``` You should access the `totalIngredients` property of `recipe1`. ```js -assert.match(code, /recipe1\.totalIngredients/) +assert.isNotNull(recipe1.totalIngredients); ``` -You should set the `totalIngredients` of `recipe1` you accessed to the calling of `getTotalIngredients` with `recipe1.ingredients` as its parameter. +You should assign the result of calling `getTotalIngredients` with `recipe1.ingredients` to the `totalIngredients` property of `recipe1`. ```js -assert.match(code, /recipe1\.totalIngredients\s*=\s*getTotalIngredients\(recipe1\.ingredients\);?/) +assert.strictEqual(recipe1.totalIngredients, getTotalIngredients(recipe1.ingredients)); ``` You should access the `difficultyLevel` property of `recipe1`. ```js -assert.match(code, /recipe1\.difficultyLevel/) +assert.isNotEmpty(recipe1.difficultyLevel); ``` -You should set the `difficultyLevel` of `recipe1` you accessed to the calling of `getDifficultyLevel` with `recipe1.cookingTime` as its parameter. +You should assign the result of calling `getDifficultyLevel` with `recipe1.cookingTime` to the `cookingTime` property of `recipe1`. ```js -assert.match(code, /recipe1\.difficultyLevel\s*=\s*getDifficultyLevel\(recipe1\.cookingTime\);?/) +assert.strictEqual(recipe1.difficultyLevel, getDifficultyLevel(recipe1.cookingTime)); ``` # --seed-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5636.md b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5636.md index bd9aceddf5..8f45a98cbd 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5636.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5636.md @@ -14,37 +14,37 @@ Repeat the process for the `averageRating`, `totalIngredients`, and `difficultyL You should access the `averageRating` property of `recipe2`. ```js -assert.match(code, /recipe2\.averageRating/) +assert.isNotNull(recipe2.averageRating); ``` -You should set the `averageRating` of `recipe2` you accessed to the calling of `getAverageRating` with `recipe1.ratings` as its parameter. +You should assign the result of calling `getAverageRating` with `recipe2.ratings` to the `averageRating` property of `recipe2`. ```js -assert.match(code, /recipe2\.averageRating\s*=\s*getAverageRating\(recipe2\.ratings\);?/) +assert.strictEqual(recipe2.averageRating, getAverageRating(recipe2.ratings)); ``` You should access the `totalIngredients` property of `recipe2`. ```js -assert.match(code, /recipe2\.totalIngredients/) +assert.isNotNull(recipe2.totalIngredients); ``` -You should set the `totalIngredients` of `recipe2` you accessed to the calling of `getTotalIngredients` with `recipe2.ingredients` as its parameter. +You should assign the result of calling `getTotalIngredients` with `recipe2.ingredients` to the `totalIngredients` property of `recipe2`. ```js -assert.match(code, /recipe2\.totalIngredients\s*=\s*getTotalIngredients\(recipe2\.ingredients\);?/) +assert.strictEqual(recipe2.totalIngredients, getTotalIngredients(recipe2.ingredients)); ``` You should access the `difficultyLevel` property of `recipe2`. ```js -assert.match(code, /recipe2\.difficultyLevel/) +assert.isNotEmpty(recipe2.difficultyLevel); ``` -You should set the `difficultyLevel` of `recipe2` you accessed to the calling of `getDifficultyLevel` with `recipe2.cookingTime` as its parameter. +You should assign the result of calling `getDifficultyLevel` with `recipe2.cookingTime` to the `difficultyLevel` property of `recipe2`. ```js -assert.match(code, /recipe2\.difficultyLevel\s*=\s*getDifficultyLevel\(recipe2\.cookingTime\);?/) +assert.strictEqual(recipe2.difficultyLevel, getDifficultyLevel(recipe2.cookingTime)); ``` # --seed-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/670e4f45f7116c0f216a5177.md b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/670e4f45f7116c0f216a5177.md index dc26e12dbe..5577460076 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/670e4f45f7116c0f216a5177.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-recipe-tracker/670e4f45f7116c0f216a5177.md @@ -33,73 +33,73 @@ Make sure all the variables you created are logged to the console. You should create a `recipe1Name` variable. ```js -assert.isNotNull(recipe1Name) +assert.isDefined(recipe1Name); ``` -You should set your `recipe1Name` variable to the accessment of the `name` property of `recipe1`. +You should assign the value of the `name` property of `recipe1` to your `recipe1name` variable. ```js -assert.match(code, /recipe1\.name|recipe1\[("|'|`)name("|'|`)\]/) +assert.strictEqual(recipe1Name, recipe1.name); ``` You should log `recipe1Name` to the console. ```js -assert.match(code, /console\.log\(recipe1Name\)/) +assert.match(code, /console\.log\(\s*recipe1Name\s*\)/); ``` You should create a `recipe2Name` variable. ```js -assert.isNotNull(recipe2Name) +assert.isDefined(recipe2Name); ``` -You should set your `recipe2Name` variable to the accessment of the `name` property of `recipe2`. +You should assign the value of the `name` property of `recipe2` to your `recipe2name` variable. ```js -assert.match(code, /recipe2\.name|recipe2\[("|'|`)name("|'|`)\]/) +assert.strictEqual(recipe2Name, recipe2.name); ``` You should log `recipe2Name` to the console. ```js -assert.match(code, /console\.log\(recipe2Name\)/) +assert.match(code, /console\.log\(recipe2Name\)/); ``` You should create a `recipe1CookingTime` variable. ```js -assert.isNotNull(recipe1CookingTime) +assert.isDefined(recipe1CookingTime); ``` -You should set your `recipe1CookingTime` variable to the accessment of the `cookingTime` property of `recipe1`. +You should assign the value of the `cookingTime` property of `recipe1` to your `recipe1CookingTime` variable. ```js -assert.match(code, /recipe1\.cookingTime|recipe1\[("|'|`)cookingTime("|'|`)\]/) +assert.strictEqual(recipe1CookingTime, recipe1.cookingTime); ``` You should log `recipe1CookingTime` to the console. ```js -assert.match(code, /console\.log\(recipe1CookingTime\)/) +assert.match(code, /console\.log\(recipe1CookingTime\)/); ``` You should create a `recipe2CookingTime` variable. ```js -assert.isNotNull(recipe2CookingTime) +assert.isDefined(recipe2CookingTime); ``` -You should set your `recipe2CookingTime` variable to the accessment of the `cookingTime` property of `recipe2`. +You should assign the value of the `cookingTime` property of `recipe2` to your `recipe2CookingTime` variable. ```js -assert.match(code, /recipe2\.cookingTime|recipe2\[("|'|`)cookingTime("|'|`)\]/) +assert.strictEqual(recipe2CookingTime, recipe2.cookingTime); ``` You should log `recipe2CookingTime` to the console. ```js -assert.match(code, /console\.log\(recipe2CookingTime\)/) +assert.match(code, /console\.log\(recipe2CookingTime\)/); ``` # --seed-- diff --git a/curriculum/challenges/japanese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/japanese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md index f4fd5f59fe..5cbadd7911 100644 --- a/curriculum/challenges/japanese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/japanese/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set You should create a `div` element with the class `task`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` Your `div` element should have the `id` `${id}`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/korean/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/korean/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md index f4fd5f59fe..5cbadd7911 100644 --- a/curriculum/challenges/korean/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/korean/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set You should create a `div` element with the class `task`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` Your `div` element should have the `id` `${id}`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/korean/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md b/curriculum/challenges/korean/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md index fa8f960b12..3772e78d60 100644 --- a/curriculum/challenges/korean/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md +++ b/curriculum/challenges/korean/17-college-algebra-with-python/learn-applications-of-linear-systems/word-problems.md @@ -14,7 +14,9 @@ This first video will look at key words that tell you what math operation to use \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">Business Math, a Step-by-Step Handbook (2021) by Jean-Paul Oliver</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/korean/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md b/curriculum/challenges/korean/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md index c0bd01e06b..0f5cadbead 100644 --- a/curriculum/challenges/korean/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md +++ b/curriculum/challenges/korean/17-college-algebra-with-python/learn-ratios-and-proportions/introduction-to-college-algebra-with-python.md @@ -14,7 +14,9 @@ This first video includes an introduction to the course, how it will work, and h \- <a href="https://lyryx.com/subjects/business/business-mathematics/" target="_blank" rel="noopener noreferrer nofollow">Business Math, a Step-by-Step Handbook (2021) by Jean-Paul Oliver</a> -\- <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> +\- <a href="https://cdn.freecodecamp.org/curriculum/college-algebra/AlgebraAndTrigonometry-OP_1tE6R5r.pdf" target="_blank" rel="noopener noreferrer nofollow">Algebra and Trigonometry by Jay Abramson</a> - sourced from OpenStax under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International (CC BY 4.0)</a> + +It is also possible to download the Algebra and Trigonometry textbook from the <a href="https://openstax.org/details/books/algebra-and-trigonometry" target="_blank" rel="noopener noreferrer nofollow">OpenStax website</a>. You will need to find the correct textbook and then download the PDF. The page numbers for the assignment are based on the first link for this book. # --assignment-- diff --git a/curriculum/challenges/korean/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md b/curriculum/challenges/korean/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md index dc90df92b0..d62e911d9d 100644 --- a/curriculum/challenges/korean/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md +++ b/curriculum/challenges/korean/24-b1-english-for-developers/learn-how-to-describe-places-and-events/66c62747744dc4178785207d.md @@ -40,7 +40,7 @@ Because the IDEs are not installed correctly. ### --feedback-- -TOm is not frustrated about instalation. +Tom is not frustrated about installation. --- diff --git a/curriculum/challenges/korean/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md b/curriculum/challenges/korean/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md index ce9b50cd80..8de355f897 100644 --- a/curriculum/challenges/korean/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md +++ b/curriculum/challenges/korean/25-front-end-development/lab-bookmark-manager-app/66def5467aee701733aaf8cc.md @@ -14,7 +14,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab **User Stories:** -1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, the `getBookmarks` function should return an empty array. +1. You should have a `getBookmarks` function that returns the `bookmarks` array stored in the local storage. If the `bookmarks` key has not been set yet, or it doesn't contain a valid array with bookmarks, the `getBookmarks` function should return an empty array. 1. The `bookmarks` key stored in the local storage should be an array of bookmark objects. Each bookmark object should have three keys: `name`, `category`, and `url`. 1. You should have a function named `displayOrCloseForm` that toggles the `hidden` class on `#main-section` and `#form-section`. 1. When you click `#add-bookmark-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown` and call `displayOrCloseForm` to display the form section and hide the main section. @@ -24,10 +24,10 @@ Fulfill the user stories below and get all the tests to pass to complete the lab 1. You should have a function named `displayOrHideCategory` that toggles the `hidden` class on `#main-section` and `#bookmark-list-section`. 1. When you click `#view-category-button`, you should update the inner text of `.category-name` to be the value of the selected option from `#category-dropdown`, modify the inner HTML of `#category-list` according to the user stories below, and call the `displayOrHideCategory` function. 1. If none of the bookmarks in local storage have the category, you should set the inner HTML of the `#category-list` to a `p` element with the text `No Bookmarks Found`. -1. If one or more bookmarks in local storage have the selected category you should add a radio button with `id` and `value` attributes set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. +1. If one or more bookmarks in local storage have the selected category, you should add a radio button with `id` and `value` attributes, and set to the bookmark name to the `#category-list`'s inner HTML for each of those bookmarks. Additionally, each radio button should have the same `name` attribute. 1. Each radio button should have a corresponding label containing an anchor element with the bookmark name and the `href` attribute set to the bookmark URL. -1. When you click `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. -1. When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +1. When you click the `#close-list-button`, you should run your function to hide the `#bookmark-list-section` and display the main section. +1. When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. # --hints-- @@ -69,6 +69,24 @@ try { } ``` +When the `bookmarks` key in the `localStorage` does not contain a valid array of bookmark objects, the `getBookmarks` function should return an empty array. + +```js +try { + localStorage.setItem("bookmarks", 'invalid'); + const arrayFromInvalidValue = getBookmarks(); + assert.isArray(arrayFromInvalidValue); + assert.isEmpty(arrayFromInvalidValue); + + localStorage.setItem("bookmarks", JSON.stringify([{name: "example1", category: "news", notUrl: "example1.com"}])); + const arrayFromInvalidArray = getBookmarks(); + assert.isArray(arrayFromInvalidArray) + assert.isEmpty(arrayFromInvalidArray) +} finally { + resetLocalStorage(); +} +``` + You should have a function named `displayOrCloseForm`. ```js @@ -201,7 +219,7 @@ try { } ``` -When you click `#view-category-button`, you should modify `#category-list`'s inner HTML by adding a radio button having the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. +When you click the `#view-category-button`, you should modify the `#category-list` element's inner HTML by adding a radio button. The radio button should have the `id` and `value` attributes set to the bookmark name for each bookmark in the selected category. Additionally, each radio button should have the same `name` attribute. ```js try { @@ -214,6 +232,8 @@ try { assert.strictEqual(bookmarksDisplayed[0].value, "example1"); assert.strictEqual(bookmarksDisplayed[1].id, "example4"); assert.strictEqual(bookmarksDisplayed[1].value, "example4"); + assert.isOk(bookmarksDisplayed[0].name) + assert.strictEqual(bookmarksDisplayed[0].name, bookmarksDisplayed[1].name); } finally { resetLocalStorage(); } @@ -262,7 +282,49 @@ closeListButtonTest.dispatchEvent(new Event("click")); assert.strictEqual(getHidden("bookmark list"), "bookmark list"); ``` -When you click `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button from the local storage and update the displayed bookmark list. +When you click the `#close-list-button` and then open any category, the `#category-list` should contain only data relevant for the selected category, without duplicating entries. + +```js +setLocalStorage(); +try { + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const categoryList = document.getElementById("category-list").innerHTML; + assert.strictEqual(categoryList, "<p>No Bookmarks Found</p>"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "news"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const newsBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(newsBookmarks, 2); + assert.strictEqual(newsBookmarks[0].id, "example1"); + assert.strictEqual(newsBookmarks[0].value, "example1"); + assert.strictEqual(newsBookmarks[1].id, "example4"); + assert.strictEqual(newsBookmarks[1].value, "example4"); + + closeListButtonTest.dispatchEvent(new Event("click")); + categoryDropdownTest.value = "work"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const workBookmarks = document.querySelectorAll('#category-list input[type="radio"]'); + assert.lengthOf(workBookmarks, 1); + assert.strictEqual(workBookmarks[0].id, "example3"); + assert.strictEqual(workBookmarks[0].value, "example3"); + + categoryDropdownTest.value = "miscellaneous"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + + const paragraphs = document.querySelectorAll("#category-list p"); + assert.lengthOf(paragraphs, 1); + assert.strictEqual(paragraphs[0].innerText, "No Bookmarks Found"); +} finally { + resetLocalStorage(); + clearCategoryList(); +} +``` + +When you click the `#delete-bookmark-button`, you should delete the bookmark corresponding to the selected radio button and appropriate category from the local storage and update the displayed bookmark list. ```js setLocalStorage(); @@ -282,6 +344,16 @@ try { const expected = [{name: "example2", category: "entertainment", url: "example2.com"}, {name: "example3", category: "work", url: "example3.com"}, {name: "example4", category: "news", url: "example4.com"}]; assert.deepEqual(getBookmarks(), expected); + localStorage.setItem("bookmarks", JSON.stringify([{name: "duplicated-name", category: "news", url: "example1.com"}, {name: "duplicated-name", category: "entertainment", url: "example2.com"}])); + + categoryDropdownTest.value = "entertainment"; + viewCategoryButtonTest.dispatchEvent(new Event("click")); + const radioForDuplicate = document.querySelector('#category-list input[type="radio"]'); + radioForDuplicate.checked = true; + + deleteBookmarkButtonTest.dispatchEvent(new Event("click")); + + assert.deepEqual(getBookmarks(), [{name: "duplicated-name", category: "news", url: "example1.com"}]) } finally { resetLocalStorage(); } @@ -529,7 +601,26 @@ const addBookmarkButtonForm = document.getElementById("add-bookmark-button-form" const categoryList = document.getElementById("category-list"); const closeListButton = document.getElementById("close-list-button"); const deleteBookmarkButton = document.getElementById("delete-bookmark-button"); -const getBookmarks = () => JSON.parse(localStorage.getItem("bookmarks")) || []; + +const getBookmarks = () => { + try { + const parsed = JSON.parse(localStorage.getItem("bookmarks")); + if ( + Array.isArray(parsed) && + parsed.every( + (item) => + item.hasOwnProperty("category") && + item.hasOwnProperty("name") && + item.hasOwnProperty("url"), + ) + ) { + return parsed; + } + return []; + } catch { + return []; + } +}; const displayOrCloseForm = () => { mainSection.classList.toggle("hidden"); @@ -570,12 +661,7 @@ const displayOrHideCategory = () => { const fillBookmarkList = () => { categoryHeading[1].innerText = categoryDropdown.value.charAt(0).toUpperCase() + categoryDropdown.value.slice(1); - const bookmarksToDisplay = getBookmarks().filter((i) => { - if (i.category === categoryDropdown.value) { - return true - } - return false - }); + const bookmarksToDisplay = getBookmarks().filter((i) => i.category === categoryDropdown.value); if (bookmarksToDisplay.length) { categoryList.innerHTML = ''; for (const bookmark of bookmarksToDisplay) { @@ -604,7 +690,7 @@ const deleteBookmark = () => { for (const radioBookmark of radioBookmarks) { if (radioBookmark.checked) { const bookmarks = getBookmarks(); - const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value); + const indexToRemove = bookmarks.findIndex(i => i.name == radioBookmark.value && i.category === categoryDropdown.value); bookmarks.splice(indexToRemove, 1); localStorage.setItem("bookmarks", JSON.stringify(bookmarks)); return diff --git a/curriculum/challenges/korean/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md b/curriculum/challenges/korean/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md index fba79087f2..b14acff58a 100644 --- a/curriculum/challenges/korean/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md +++ b/curriculum/challenges/korean/25-front-end-development/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md @@ -58,6 +58,12 @@ With `2024` as the value of the `year` variable, the `result` should be `2024 is assert.strictEqual(isLeapYear(2024), '2024 is a leap year.'); ``` +With `2000` as the value of the `year` variable, the `result` should be `2000 is a leap year.`. + +```js +assert.strictEqual(isLeapYear(2000), '2000 is a leap year.'); +``` + With `1900` as the value of the `year` variable, the `result` should be `1900 is not a leap year.`. ```js @@ -74,7 +80,7 @@ assert.match(__helpers.removeJSComments(code), /isLeapYear\(\s*year\s*\)/); You should store the result of calling the `isLeapYear` function in a variable named `result`. ```js -assert.match(__helpers.removeJSComments(code), /const\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); +assert.match(__helpers.removeJSComments(code), /(?:var|let|const)\s+result\s*=\s*isLeapYear\(\s*year\s*\)/); ``` You should output the `result` to the console using `console.log()`. diff --git a/curriculum/challenges/korean/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md b/curriculum/challenges/korean/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md index 126472eae6..f7fa9a2824 100644 --- a/curriculum/challenges/korean/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md +++ b/curriculum/challenges/korean/25-front-end-development/lab-travel-agency-page/669e2f60e83c011754f711f9.md @@ -159,13 +159,13 @@ for (let e of listItems) { The anchor element of your first list item should wrap the text `Group Travels`. ```js -assert.equal(document.querySelectorAll('a')[0]?.innerText, 'Group Travels'); +assert.equal(document.querySelectorAll('li > a')[0]?.innerText, 'Group Travels'); ``` The anchor element of your second list item should wrap the text `Private Tours`. ```js -assert.equal(document.querySelectorAll('a')[1]?.innerText, 'Private Tours'); +assert.equal(document.querySelectorAll('li > a')[1]?.innerText, 'Private Tours'); ``` You should have an `h2` element after your unordered list. diff --git a/curriculum/challenges/korean/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md b/curriculum/challenges/korean/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md index cfa1be8adc..08fe131107 100644 --- a/curriculum/challenges/korean/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md +++ b/curriculum/challenges/korean/25-front-end-development/lecture-welcome-to-freecodecamp/6734e2c5780912abd874e79c.md @@ -86,36 +86,36 @@ All of the above. ## --text-- -What is the recommended strategy for pacing yourself through the freeCodeCamp certification coursework? +What makes each freeCodeCamp certification unique? ## --answers-- -Code for several hours one day a week. +It has its own unique verification URL. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Code for half an hour every day. - ---- - -Complete all coursework in one month. +It has its own unique serial number. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. --- -Work only on weekends. +It has its own QR code. ### --feedback-- -Learning to code is a marathon, not a sprint. +Think about the features mentioned that verify authenticity and uniqueness. + +--- + +All of the above. ## --video-solution-- -2 +4 diff --git a/curriculum/challenges/korean/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md b/curriculum/challenges/korean/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md index bbd535265b..c5d6ecb6eb 100644 --- a/curriculum/challenges/korean/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md +++ b/curriculum/challenges/korean/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md @@ -2,7 +2,7 @@ id: 672d269da46786225e3fe3fd title: What Is the Purpose of Functions, and How Do They Work? challengeType: 11 -videoId: sU2mIGNjBtc +videoId: maLeO3YCqxs dashedName: what-is-the-purpose-of-functions-and-how-do-they-work --- diff --git a/curriculum/challenges/korean/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md b/curriculum/challenges/korean/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md index d9f2af9f09..9999634949 100644 --- a/curriculum/challenges/korean/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md +++ b/curriculum/challenges/korean/25-front-end-development/lecture-working-with-strings-in-javascript/673263e80dd43da7df3ae565.md @@ -86,7 +86,7 @@ Remember, you can pass a second argument to the method to control where the sear ## --text-- -What type of function is `indexOf` in JavaScript? +What type of method is `indexOf` in JavaScript? ## --answers-- @@ -94,15 +94,15 @@ A standalone function. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- -A method of the `Array` object. +A method of the `Date` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. --- @@ -110,11 +110,11 @@ A method of the `String` object. --- -A mathematical function. +A method of the `Math` object. ### --feedback-- -Methods are functions that belong to specific objects in JavaScript. +Consider the type of object that deals with text in JavaScript. ## --video-solution-- diff --git a/curriculum/challenges/korean/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md b/curriculum/challenges/korean/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md index 06e0471e54..090bfa7177 100644 --- a/curriculum/challenges/korean/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md +++ b/curriculum/challenges/korean/25-front-end-development/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md @@ -215,7 +215,7 @@ Which selector is correct to target the next sibling of an `img`? #### --text-- -Which selector is correct to target all siblings of an `img`? +Which selector is correct to target all siblings preceded by an `img` element? #### --distractors-- diff --git a/curriculum/challenges/korean/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md b/curriculum/challenges/korean/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md index 6c8140bf6d..45ba4f942a 100644 --- a/curriculum/challenges/korean/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md +++ b/curriculum/challenges/korean/25-front-end-development/quiz-css-typography/66ed9010f45ce3ece4053eb8.md @@ -171,7 +171,7 @@ It allows you to use custom fonts by importing them #### --text-- -Which service offers a large selection of free fonts for use on websites? +Which service offers a large selection of free fonts that can be easily integrated directly into websites? #### --distractors-- @@ -183,7 +183,7 @@ Adobe Fonts --- -Font Squirrel +Font Universe #### --answer-- diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md b/curriculum/challenges/korean/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md index 158f16ace0..0a29275720 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-blog-page/669fd6fd12918e3de87854d4.md @@ -9,7 +9,7 @@ dashedName: step-8 For your blog, there should be a way for users to navigate to different sections on the page. -The `nav` element is used to to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. +The `nav` element is used to provide navigation links to other sections in the document or other sections in the website. A lot of times you will see the `nav` element used for menus or table of contents. Here is an example of using the `nav` element: diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md index a7eceb9838..6e2843ac9e 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a98f42c7c06903e5f8dd07.md @@ -8,7 +8,7 @@ demoType: onLoad # --description-- -In this workshop, you will learn how to work with HTML tables by building a final exam table for a group of students. +In this workshop, you will practice working with HTML tables by building a final exam table for a group of students. To begin the project, add the `<!DOCTYPE html>`, and an `html` element with a `lang` attribute of `en`. diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md index 749b896770..2208c48576 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b48a211a73155621d0df.md @@ -29,7 +29,7 @@ Your `table` element should be inside your `body` element. ```js const tableEl = document.querySelector('table'); -assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); +assert.strictEqual(tableEl?.parentElement?.tagName, 'BODY'); ``` # --seed-- @@ -44,9 +44,9 @@ assert.strictEqual(tableEl.parentElement.tagName, 'BODY'); <meta charset="UTF-8" /> </head> <body> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </body> </html> ``` diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md index 28fb722186..929faf3cec 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9b8f14b963916a3baa732.md @@ -7,7 +7,7 @@ dashedName: step-4 # --description-- -To add a caption to a `table`, you can use the table <dfn>caption</dfn> element. +To add a caption to a `table`, you can use the <dfn>table caption</dfn> element. Here is an example using the `caption` element: diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md index 5f03924649..ae073b4957 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bb8578459a175432e7d0.md @@ -9,7 +9,7 @@ dashedName: step-5 For the first section of the table, you will want to group the header content which represents the column labels for the student's first name, last name, and final exam grade. -The `table head` element, `<thead>`, is used to group the header content in a table. +The <dfn>table head</dfn> element, `thead`, is used to group the header content in a table. Here is an example using the `thead` element: @@ -21,7 +21,7 @@ Here is an example using the `thead` element: </table> ``` -Below your `caption` element, add a `table head` element. +Below your `caption` element, add a table head element. # --hints-- @@ -41,7 +41,7 @@ Your `thead` element should be inside your `table` element. ```js const theadEl = document.querySelector('thead'); -assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); +assert.strictEqual(theadEl?.parentElement?.tagName, 'TABLE'); ``` # --seed-- @@ -60,9 +60,9 @@ assert.strictEqual(theadEl.parentElement.tagName, 'TABLE'); <caption> Calculus Final Exam Grades </caption> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md index 74e04fe8f4..05d10098e4 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9bcf00f13a418368a272e.md @@ -7,7 +7,7 @@ dashedName: step-6 # --description-- -The `table head` element consists of a `table row` element, `<tr>`, which contains the `table header` cell elements, `<th>`. +The table head element consists of a <dfn>table row</dfn> element, `tr`, which contains the <dfn>table header cell</dfn> elements, `th`. Here is an example using the `tr` and `th` elements for a sports table: @@ -48,28 +48,28 @@ Your `tr` element should be inside your `thead` element. ```js const trEl = document.querySelector('tr'); -assert.strictEqual(trEl.parentElement.tagName, 'THEAD'); +assert.strictEqual(trEl?.parentElement?.tagName, 'THEAD'); ``` Your first `th` element should have the text of `Last Name`. ```js const thEl = document.querySelectorAll('th')[0]; -assert.strictEqual(thEl.textContent, 'Last Name'); +assert.strictEqual(thEl?.textContent, 'Last Name'); ``` Your second `th` element should have the text of `First Name`. ```js const thEl = document.querySelectorAll('th')[1]; -assert.strictEqual(thEl.textContent, 'First Name'); +assert.strictEqual(thEl?.textContent, 'First Name'); ``` Your third `th` element should have the text of `Grade`. ```js const thEl = document.querySelectorAll('th')[2]; -assert.strictEqual(thEl.textContent, 'Grade'); +assert.strictEqual(thEl?.textContent, 'Grade'); ``` All of your `th` elements should be inside your `tr` element. diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md index 83d56bbd51..93019aafba 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c006e4f58819396605b3.md @@ -7,9 +7,9 @@ dashedName: step-7 # --description-- -Now that you have completed the head section, it is time to add the `table body`. The `table body` will represent all of the student names and their grades. +Now that you have completed the head section, it is time to add the <dfn>table body</dfn>, `tbody`. The table body will represent all of the student names and their grades. -Add a `table body` element to your table. +Add a table body element to your table. # --hints-- @@ -55,10 +55,9 @@ assert.match(code, /<tbody>[\s\S]*<\/tbody>/i); <th>Grade</th> </tr> </thead> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md index 147a0ca76e..840c1e9226 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c14e3b34c719e34bae20.md @@ -7,9 +7,9 @@ dashedName: step-8 # --description-- -To add student data to the table, you will need to use the `table row` and <dfn>table data</dfn> elements. +To add student data to the table, you will need to use the table row and table data elements. -The `table data` element, `<td>`, is used to create a cell in the table. +The <dfn>table data</dfn> element, `td`, is used to create a cell in the table. Here is an example of using the `td` element for a sports players table: @@ -21,29 +21,17 @@ Here is an example of using the `td` element for a sports players table: </tr> ``` -Inside your `table body` element, add a `table row` element, `<tr>`, with three `table data` elements, `<td>`. +Inside your table body element, add a table row element, `tr`, with three table data elements, `td`. -The first `table data` element should contain the last name of `Davis`. +The first table data element should contain the last name of `Davis`. -The second `table data` element should contain the first name of `Alex`. +The second table data element should contain the first name of `Alex`. -The third `table data` element should contain the grade of `54`. +The third table data element should contain the grade of `54`. # --hints-- -You should have an opening `tr` tag. - -```js -assert.match(code, /<tr>/i); -``` - -You should have a closing `tr` tag. - -```js -assert.match(code, /<\/tr>/i); -``` - -Your `tr` element should be inside your `tbody` element. +You should have a `tr` element inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr')); @@ -52,19 +40,19 @@ assert.isNotNull(document.querySelector('tbody tr')); You should have a `td` element with the text `Davis` inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr td').textContent, 'Davis'); +assert.strictEqual(document.querySelector('tbody tr td')?.textContent, 'Davis'); ``` You should have a `td` element with the text `Alex` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[1].textContent, 'Alex'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[1]?.textContent, 'Alex'); ``` You should have a `td` element with the text `54` inside the `tr` element. ```js -assert.strictEqual(document.querySelectorAll('tbody tr td')[2].textContent, '54'); +assert.strictEqual(document.querySelectorAll('tbody tr td')[2]?.textContent, '54'); ``` You should have all three of the `td` elements inside the `tr` element. @@ -99,9 +87,9 @@ assert.match(code, /<tr>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*<td>[\s\S]*<\/td>[\s\S]*< </thead> <tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md index 83b5b4ca3b..22e7a8d7f9 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9c7a4521d2b1b1ec6dcf0.md @@ -9,13 +9,13 @@ dashedName: step-9 Now it is time to add two more students to the table. -Following the same pattern as the previous step, add a second student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous step, add a second student table row. Use the following data for the table data elements: - Last Name: `Doe` - First Name: `Samantha` - Grade: `92` -For the third student `table row`, use the following data for the `table data` elements: +For the third student table row, use the following data for the table data elements: - Last Name: `Rodriguez` - First Name: `Marcus` @@ -23,7 +23,7 @@ For the third student `table row`, use the following data for the `table data` e # --hints-- -You should have a second `table row` inside your `tbody` element. +You should have a second `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(2)')); You should have a `td` element with the text `Doe` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child').textContent, 'Doe'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:first-child')?.textContent, 'Doe'); ``` You should have a `td` element with the text `Samantha` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)').textContent, 'Samantha'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:nth-child(2)')?.textContent, 'Samantha'); ``` You should have a `td` element with the text `92` inside the second `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child').textContent, '92'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(2) td:last-child')?.textContent, '92'); ``` -You should have a third `table row` inside your `tbody` element. +You should have a third `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 3); You should have a `td` element with the text `Rodriguez` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child').textContent, 'Rodriguez'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:first-child')?.textContent, 'Rodriguez'); ``` You should have a `td` element with the text `Marcus` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)').textContent, 'Marcus'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:nth-child(2)')?.textContent, 'Marcus'); ``` You should have a `td` element with the text `88` inside the third `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child').textContent, '88'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child')?.textContent, '88'); ``` # --seed-- @@ -102,10 +102,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(3) td:last-child <td>Alex</td> <td>54</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md index 40363b344c..db72b2f34d 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9ca099e3ecb1be10a2696.md @@ -9,13 +9,13 @@ dashedName: step-10 Now it is time to add two more students to the table. -Following the same pattern as the previous steps, add a fourth student `table row`. Use the following data for the `table data` elements: +Following the same pattern as the previous steps, add a fourth student table row. Use the following data for the table data elements: - Last Name: `Thompson` - First Name: `Jane` - Grade: `77` -For the fifth student `table row`, use the following data for the `table data` elements: +For the fifth student table row, use the following data for the table data elements: - Last Name: `Williams` - First Name: `Natalie` @@ -23,7 +23,7 @@ For the fifth student `table row`, use the following data for the `table data` e # --hints-- -You should have a fourth `table row` inside your `tbody` element. +You should have a fourth `tr` inside your `tbody` element. ```js assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); @@ -32,22 +32,22 @@ assert.isNotNull(document.querySelector('tbody tr:nth-of-type(4)')); You should have a `td` element with the text `Thompson` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child').textContent, 'Thompson'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:first-child')?.textContent, 'Thompson'); ``` You should have a `td` element with the text `Jane` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)').textContent, 'Jane'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(2)')?.textContent, 'Jane'); ``` You should have a `td` element with the text `77` inside the fourth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)').textContent, '77'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(4) td:nth-of-type(3)')?.textContent, '77'); ``` -You should have a fifth `table row` inside your `tbody` element. +You should have a fifth `tr` inside your `tbody` element. ```js assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); @@ -56,19 +56,19 @@ assert.strictEqual(document.querySelectorAll('tbody tr').length, 5); You should have a `td` element with the text `Williams` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child').textContent, 'Williams'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:first-child')?.textContent, 'Williams'); ``` You should have a `td` element with the text `Natalie` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)').textContent, 'Natalie'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(2)')?.textContent, 'Natalie'); ``` You should have a `td` element with the text `83` inside the fifth `tr` element. ```js -assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)').textContent, '83'); +assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-type(3)')?.textContent, '83'); ``` # --seed-- @@ -114,10 +114,9 @@ assert.strictEqual(document.querySelector('tbody tr:nth-of-type(5) td:nth-of-typ <td>Marcus</td> <td>88</td> </tr> +--fcc-editable-region-- - --fcc-editable-region-- - - --fcc-editable-region-- +--fcc-editable-region-- </tbody> </table> </body> diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md index cf42af9e11..d1033d9888 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-final-exams-table/66a9cb26ec6bd41cf6c82bc5.md @@ -7,7 +7,7 @@ dashedName: step-11 # --description-- -The last section to add to the table would be the `table foot` (`<tfoot>`) element. The `table foot` element will be used to display the average grade for all of the students in the table. +The last section to add to the table would be the <dfn>table foot</dfn> element, `tfoot`. The table foot element will be used to display the average grade for all of the students in the table. Add a `tfoot` element to the table. @@ -40,13 +40,13 @@ assert.isNotNull(document.querySelector('tfoot tr')); Your first `td` element should contain the text `Average Grade`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:first-child').textContent, 'Average Grade'); +assert.strictEqual(document.querySelector('tfoot tr td:first-child')?.textContent, 'Average Grade'); ``` Your second `td` element should contain the text `78.8`. Make sure it is inside the `tr` element. ```js -assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)').textContent, '78.8'); +assert.strictEqual(document.querySelector('tfoot tr td:nth-of-type(2)')?.textContent, '78.8'); ``` Your `tr` element should have two `td` elements inside it. @@ -111,9 +111,9 @@ assert.strictEqual(document.querySelectorAll('tfoot tr td').length, 2); <td>83</td> </tr> </tbody> - --fcc-editable-region-- +--fcc-editable-region-- - --fcc-editable-region-- +--fcc-editable-region-- </table> </body> </html> diff --git a/curriculum/challenges/korean/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/korean/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md index f4fd5f59fe..5cbadd7911 100644 --- a/curriculum/challenges/korean/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/korean/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set You should create a `div` element with the class `task`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` Your `div` element should have the `id` `${id}`. ```js -assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed--