diff --git "a/freeCodeCamp/c2i/test/queries.jsonl" "b/freeCodeCamp/c2i/test/queries.jsonl" new file mode 100644--- /dev/null +++ "b/freeCodeCamp/c2i/test/queries.jsonl" @@ -0,0 +1,200 @@ +{"_id":"q-en-freeCodeCamp-0027c152c40d885a5c1739ca68ddcd30b0555c812a7be0d84e57556505e54f6d","text":"def draw(self, number): drawn = [] if number >= len(self.contents): return self.contents drawn.extend(self.contents) self.contents = [] else: for i in range(number): drawn.append("} +{"_id":"q-en-freeCodeCamp-008b273577a49ba4a2871b50fd3a1257f0d0f6296de62adbfbd41a8e6046d2e1","text":"```` - Additional information in the form of a note should be formatted `Note: Rest of note text...` - If multiple notes are needed, then list all of the notes in separate sentences using the format `Notes: First note text. Second note text.`. - Use double quotes where applicable ## Formatting seed code"} +{"_id":"q-en-freeCodeCamp-00e7b0164a26861ae6e1f4cd9c99d997ad38e11ab1738ab90e6aee854b8039b2","text":"assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.cssRules?.[0]?.style?.fontSize === '6rem'); ``` Your `.hero-subtitle, .author, .quote, .list-header` selector should have a `font-size` set to `1.8rem`. Your `.hero-subtitle, .author, .quote, .list-title` selector should have a `font-size` set to `1.8rem`. ```js assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.cssRules?.[1]?.style?.fontSize === '1.8rem');"} +{"_id":"q-en-freeCodeCamp-042908f416b75b2b25a62e938a5bf532aaf13f6615c0115b33533a6d1dbdcf2d","text":"--- The kitchen Kitchen ### --feedback--"} +{"_id":"q-en-freeCodeCamp-056f1945a19c5797751c72f5037ec1cc29ae53a90663fcb1f1b395ee2a9c6e62","text":"\"invalid-protocol\": \"URL must start with http or https\", \"url-not-image\": \"URL must link directly to an image file\", \"use-valid-url\": \"Please use a valid URL\" }, \"certification\": { \"certifies\": \"This certifies that\", \"completed\": \"has successfully completed the freeCodeCamp.org\", \"developer\": \"Developer Certification, representing approximately\", \"executive\": \"Executive Director, freeCodeCamp.org\", \"verify\": \"Verify this certification at {{certURL}}\", \"issued\": \"Issued\" } }"} +{"_id":"q-en-freeCodeCamp-05ea99031872297fce837c5d6b5152e5c903265eef44b6e4942f3799d734f983","text":"## Instructions
Modify the myApp.js file to log \"Hello World\" to the console.
## Tests"} +{"_id":"q-en-freeCodeCamp-065de47a056ff55b6dd7fd0b7701753aaa33143c884fc6e9f8daea229768792f","text":"\"assert(Enzyme.mount(React.createElement(CheckUserAge)).find('div').find('input').length === 1 && Enzyme.mount(React.createElement(CheckUserAge)).find('div').find('button').length === 1, 'message: The CheckUserAge component should render with a single input element and a single button element.');\", \"assert(Enzyme.mount(React.createElement(CheckUserAge)).state().input === '' && Enzyme.mount(React.createElement(CheckUserAge)).state().userAge === '', 'message: The CheckUserAge component's state should be initialized with a property of userAge and a property of input, both set to a value of an empty string.');\", \"assert(Enzyme.mount(React.createElement(CheckUserAge)).find('button').text() === 'Submit', 'message: When the CheckUserAge component is first rendered to the DOM, the button's inner text should be Submit.');\", \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const initialButton = mockedComponent.find('button').text(); const enter3AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: 3 }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const enter17AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: 17 }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const userAge3 = await enter3AndClickButton(); const userAge17 = await enter17AndClickButton(); assert(initialButton === 'Submit' && userAge3 === 'You Shall Not Pass' && userAge17 === 'You Shall Not Pass', 'message: When a number of less than 18 is entered into the input element and the button is clicked, the button's inner text should read You Shall Not Pass.'); }; \", \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const initialButton = mockedComponent.find('button').text(); const enter18AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: 18 }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const enter35AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: 35 }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const userAge18 = await enter18AndClickButton(); const userAge35 = await enter35AndClickButton(); assert(initialButton === 'Submit' && userAge18 === 'You May Enter' && userAge35 === 'You May Enter', 'message: When a number greater than or equal to 18 is entered into the input element and the button is clicked, the button's inner text should read You May Enter.'); }; \", \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const enter18AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: 18 }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const changeInputDontClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: 5 }}); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const enter10AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: 10 }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const userAge18 = await enter18AndClickButton(); const changeInput1 = await changeInputDontClickButton(); const userAge10 = await enter10AndClickButton(); const changeInput2 = await changeInputDontClickButton(); assert(userAge18 === 'You May Enter' && changeInput1 === 'Submit' && userAge10 === 'You Shall Not Pass' && changeInput2 === 'Submit', 'message: Once a number has been submitted, and the value of the input is once again changed, the button should return to reading Submit.'); }; \", \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const initialButton = mockedComponent.find('button').text(); const enter3AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: '3' }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const enter17AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: '17' }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const userAge3 = await enter3AndClickButton(); const userAge17 = await enter17AndClickButton(); assert(initialButton === 'Submit' && userAge3 === 'You Shall Not Pass' && userAge17 === 'You Shall Not Pass', 'message: When a number of less than 18 is entered into the input element and the button is clicked, the button's inner text should read You Shall Not Pass.'); }; \", \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const initialButton = mockedComponent.find('button').text(); const enter18AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: '18' }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const enter35AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: '35' }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const userAge18 = await enter18AndClickButton(); const userAge35 = await enter35AndClickButton(); assert(initialButton === 'Submit' && userAge18 === 'You May Enter' && userAge35 === 'You May Enter', 'message: When a number greater than or equal to 18 is entered into the input element and the button is clicked, the button's inner text should read You May Enter.'); }; \", \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const enter18AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: '18' }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const changeInputDontClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: '5' }}); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const enter10AndClickButton = () => { mockedComponent.find('input').simulate('change', {target: { value: '10' }}); mockedComponent.find('button').simulate('click'); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find('button').text(); }); }; const userAge18 = await enter18AndClickButton(); const changeInput1 = await changeInputDontClickButton(); const userAge10 = await enter10AndClickButton(); const changeInput2 = await changeInputDontClickButton(); assert(userAge18 === 'You May Enter' && changeInput1 === 'Submit' && userAge10 === 'You Shall Not Pass' && changeInput2 === 'Submit', 'message: Once a number has been submitted, and the value of the input is once again changed, the button should return to reading Submit.'); }; \", \"assert(new RegExp(/(s|;)if(s|()/).test(Enzyme.mount(React.createElement(CheckUserAge)).instance().render.toString()) === false, 'message: Your code should not contain any if/else statements.');\" ], \"solutions\": ["} +{"_id":"q-en-freeCodeCamp-06bea0a9405cf6837c7d1a93da700adfeb06c4da6ce8655b51d4bfb05b3d2c1a","text":"# --description-- The text `* Daily Value %` should be aligned to the right. Create a `.right` selector and use the `justify-content` property to do it. The text `% Daily Value *` should be aligned to the right. Create a `.right` selector and use the `justify-content` property to do it. # --hints--"} +{"_id":"q-en-freeCodeCamp-0982b2e8a8545086a0e8f1b1c3a51117378f4ceca1b0782206e1d8e9160d433b","text":"# --description-- Create a third `@media` query for `only screen` with a `max-width` of `550px`. Within, create a `.hero-title` selector with a `font-size` set to `6rem`, a `.hero-subtitle, .author, .quote, .list-header` selector with a `font-size` set to `1.8rem`, a `.social-icons` selector with a `font-size` set to `2rem`, and a `.text` selector with a `font-size` set to `1.6rem`. Create a third `@media` query for `only screen` with a `max-width` of `550px`. Within, create a `.hero-title` selector with a `font-size` set to `6rem`, a `.hero-subtitle, .author, .quote, .list-title` selector with a `font-size` set to `1.8rem`, a `.social-icons` selector with a `font-size` set to `2rem`, and a `.text` selector with a `font-size` set to `1.6rem`. # --hints--"} +{"_id":"q-en-freeCodeCamp-09af21171be3bbfea264b818615fd4e3f2bd15955cdf0376acc16bce68076313","text":"You should declare a variable named `xp`. ```js assert.match(code, /xp/); assert.match(code, /lets+xp/); ``` You should not assign a value to your variable."} +{"_id":"q-en-freeCodeCamp-0ab9ddb161a0cc6acb7cf4d16d7c831af0212b8aa0e546e077a4efdc24825f38","text":"man -f shutdown ``` #### Display the man page of ASCII table: ```bash man ascii ``` ### More information: * [Wikipedia](https://en.wikipedia.org/wiki/Man_page)"} +{"_id":"q-en-freeCodeCamp-0b5314ea9873103f54762d1d833387c7575b863b58c57c961970da9584263735","text":"Getting Started --------------- Note: If this is your first time working with a node-gyp dependent module, please follow the [node-gyp installation guide](https://github.com/nodejs/node-gyp#installation) to ensure a working npm build. The easiest way to get started is to clone the repository:"} +{"_id":"q-en-freeCodeCamp-0c6d8004bc08a22aff644d97786a656bbe9fdcb811f0ae941e354fd6445d01d7","text":"Your `idToText` function should return the result of calling `.find()` on the `cells` array with a callback function that takes an `cell` parameter and returns `cell.id === id`. Both of your functions should use implicit returns. # --hints-- You should declare an `idToText` variable in your `evalFormula` function."} +{"_id":"q-en-freeCodeCamp-0e507c2778a574c04ea03d9c55f420aafadbf4c0fb0ccff2e5abe86dc0c21b95","text":"\"title\": \"Periodic Table Database\", \"intro\": [ \"This is one of the required projects to earn your certification.\", \"For this project, you will create Bash a script to get information about chemical elements from a periodic table database.\" \"For this project, you will create a Bash script to get information about chemical elements from a periodic table database.\" ] }, \"build-a-salon-appointment-scheduler-project\": {"} +{"_id":"q-en-freeCodeCamp-0f9f3586b612fa31a080ad0412240a6c0217e969a2c1e771713855b302bc572c","text":"

This certifies that

{t('certification.certifies')}

{displayName}

has successfully completed the freeCodeCamp.org

{t('certification.completed')}

{certTitle}

Developer Certification, representing approximately{' '} {completionTime} hours of coursework {t('certification.developer')} {completionTime} hours of coursework

"} +{"_id":"q-en-freeCodeCamp-106d6e8f8982561d7ba39569d0e5991895ac17483c49df1d29cab0b02ec0bcb7","text":"# --description-- This is one of the required projects to earn your certification. For this project, you will create Bash a script to get information about chemical elements from a periodic table database. This is one of the required projects to earn your certification. For this project, you will create a Bash script to get information about chemical elements from a periodic table database. # --instructions--"} +{"_id":"q-en-freeCodeCamp-12784011ca8f8db73a14313bcb0ae893f5e5d323a858b52c81a910bb6f45b88d","text":"--- ```js console.log(`${string1} ${string2}`); ``` ```console.log(`${string1} ${string2}`);``` ---"} +{"_id":"q-en-freeCodeCamp-13ca893009691046fa09533cf0ec1ddf45f617b77f8de70a278bf618b89656e7","text":"Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at . Required (non-virtual) DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at . Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. **User Story #1:** I can see a title element that has a corresponding `id=\"title\"`."} +{"_id":"q-en-freeCodeCamp-1581878a553b2f1b04886edd07387a5856b7664da529c1398215dcaf73859a8c","text":"# --instructions-- In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (1.2.13). But now, you want to allow the latest 1.2.x version. In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release."} +{"_id":"q-en-freeCodeCamp-177a570eba08ff180724305dedf02b887deeeb519ea6acebae02b80c4ac2bfc9","text":"return (

Full Stack Certification

Legacy Full Stack Certification

Once you've earned the following freeCodeCamp certifications, you'll be able to claim The Full Stack Developer Certification: be able to claim the Legacy Full Stack Developer Certification:

  • Responsive Web Design
  • "} +{"_id":"q-en-freeCodeCamp-1860d5cc6cdcf6c59b70664e642c96a613a05f28d571a5afcb26c98a2b18c650","text":"Functional programming is all about creating and using non-mutating functions. The last challenge introduced the `concat` method as a way to combine arrays into a new one without mutating the original arrays. Compare `concat` to the `push` method. `push` adds an item to the end of the same array it is called on, which mutates that array. Here's an example: The last challenge introduced the `concat` method as a way to merge arrays into a new array without mutating the original arrays. Compare `concat` to the `push` method. `push` adds items to the end of the same array it is called on, which mutates that array. Here's an example: ```js const arr = [1, 2, 3]; arr.push([4, 5, 6]); arr.push(4, 5, 6); ``` `arr` would have a modified value of `[1, 2, 3, [4, 5, 6]]`, which is not the functional programming way. `arr` would have a modified value of `[1, 2, 3, 4, 5, 6]`, which is not the functional programming way. `concat` offers a way to add new items to the end of an array without any mutating side effects. `concat` offers a way to merge new items to the end of an array without any mutating side effects. # --instructions-- Change the `nonMutatingPush` function so it uses `concat` to add `newItem` to the end of `original` instead of `push`. The function should return an array. Change the `nonMutatingPush` function so it uses `concat` to merge `newItem` to the end of `original` without mutating `original` or `newItem` arrays. The function should return an array. # --hints--"} +{"_id":"q-en-freeCodeCamp-1b7aeea71d3bc7c5c2095d605c4855e80d3614ad0f9b8d7f78b87b8fb779cc50","text":" # Contributors Guide # Contributor's Guide ## I want to help! We welcome pull requests from Free Code Camp campers (our students) and seasoned JavaScript developers alike! Follow these steps to contribute: 1. Check our [public Waffle Board](https://waffle.io/freecodecamp/freecodecamp). 2. Pick an issue, let us know you're working on it, and start working on it. If you've found a bug that is not on the board, [follow these steps](#found-a-bug). 3. You can find issues we are seeking assistance on by searching for the [Help Wanted](https://github.com/FreeCodeCamp/FreeCodeCamp/labels/help%20wanted) tag. 4. Feel free to ask for help in our [Help Contributors](https://gitter.im/FreeCodeCamp/HelpContributors) Gitter room. 1. Find an issue that needs assistance by searching for the [Help Wanted](https://github.com/FreeCodeCamp/FreeCodeCamp/labels/help%20wanted) tag. 2. Let us know you are working on it, by posting a comment on the issue. 3. Feel free to ask for help in our [Help Contributors](https://gitter.im/FreeCodeCamp/HelpContributors) Gitter room. If you've found a bug that is not on the board, [follow these steps](#found-a-bug). ## Contribution Guidelines 1. Fork the project: [How To Fork And Maintain a Local Instance of Free Code Camp](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/How-To-Fork-And-Maintain-a-Local-Instance-of-Free-Code-Camp) 2. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches)) 3. Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example `fix/email-login` would be a branch where I fix something specific to email login. 4. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summary of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line. 4. [Set up Linting](#linting-setup) to run as you make changes. 5. When you are ready to share your code, run the test suite `npm test` and ensure all tests pass. For Windows contributors, skip the jsonlint pretest run by using `npm run test-challenges`, as jsonlint will always fail on Windows, given the wildcard parameters. 5. Squash your Commits. Ref: [rebasing](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/git-rebase) 6. Once your code is ready, submit a [pull request](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Pull-Request-Contribute) from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. 6. Submit a [pull request](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Pull-Request-Contribute) from your branch to Free Code Camp's `staging` branch. [Travis CI](https://travis-ci.org/FreeCodeCamp/FreeCodeCamp) will then take your code and run `npm test`. Make sure this passes, then we'll do a quick code review and give you feedback, then iterate from there. Prerequisites"} +{"_id":"q-en-freeCodeCamp-1b8a3a353d57c87b8e8bc8f1b5b2933a7a247781a39fffa4aa7f0d506d7e613b","text":"# --description-- Find the number of non-empty subsets of ${11, 22, 33, ldots, {250250}^{250250}}$, the sum of whose elements is divisible by 250. Enter the rightmost 16 digits as your answer. Find the number of non-empty subsets of ${{1}^{1}, {2}^{2}, {3}^{3}, ldots, {250250}^{250250}}$, the sum of whose elements is divisible by 250. Enter the rightmost 16 digits as your answer. # --hints--"} +{"_id":"q-en-freeCodeCamp-1b906d0c27dc693721f708222dcd4c3d9ba494ccf43ce7bf0f030a13ddcb89c7","text":"# --description-- The phrase `let me show you` can be used to direct attention and introduce something. For example: `Here's the main office area. And over there, let me show you, that's the conference room.` The phrase `let me show you` can be used to direct attention and introduce something. For example: `This is the main office area. Let me show you to the conference room.` # --question-- ## --text-- What is the speaker directing attention to after saying `let me show you`? What is Maria directing attention to? ## --answers-- The main office area Main office area ### --feedback--"} +{"_id":"q-en-freeCodeCamp-1c188e82454c818f14c6030a096429f011a61b1bd67acf2c849e136a4063b9c2","text":"import debug from 'debug'; import { isEmail } from 'validator'; import format from 'date-fns/format'; import { reportError } from '../middlewares/sentry-error-handler.js'; import { ifNoUser401 } from '../utils/middleware'; import { observeQuery } from '../utils/rx';"} +{"_id":"q-en-freeCodeCamp-1c5f380adfabbb684dd90c60fec5c50fcc55cd7ed5906d778a6e42cc6d2239a6","text":".hero-subtitle, .author, .quote, .list-header { .list-title { font-size: 1.8rem; }"} +{"_id":"q-en-freeCodeCamp-1ca92af9c7a9318709265cb74c7f2dd9e6afbdc2298cfc70b1f31d9bc73c6e15","text":"- Your function must always return the entire `records` object. - If `value` is an empty string, delete the given `prop` property from the album. - If `prop` isn't `tracks` and `value` isn't an empty string, assign the `value` to that album's `prop`. - If `prop` is `tracks` and value isn't an empty string, add the `value` to the end of the album's `tracks` array. You need to create this array first if the album does not have a `tracks` property. - If `prop` is `tracks` and `value` isn't an empty string, you need to update the album's `tracks` array. First, if the album does not have a `tracks` property, assign it an empty array. Then add the `value` as the last item in the album's `tracks` array. **Note:** A copy of the `recordCollection` object is used for the tests. You should not directly modify the `recordCollection` object."} +{"_id":"q-en-freeCodeCamp-1caaf0bb206d255294a1d5f8fa11a27db22eec215fb0de23e1bfbc9e312cde25","text":"programmer = \"CamperChan\"; ``` Note that when reassigning a variable that has already been declared, you do **not** use the `let` keyword. Note that when reassigning a variable, you do **not** use the `let` keyword again. After your `console.log`, assign the value `\"World\"` to your `character` variable."} +{"_id":"q-en-freeCodeCamp-1d16868d0b78e376669e1122323424e41bf71194256f4c36aa77f7ac541fcabb","text":"Your `#video` should have a `src` attribute. ```js const el = document.getElementById('video') assert(!!el && !!el.src) let el = document.getElementById('video') const sourceNode = el.children; let sourceElement = null; if (sourceNode.length) { sourceElement = [...video.children].filter(el => el.localName === 'source')[0]; } if (sourceElement) { el = sourceElement; } assert(el.hasAttribute('src')); ``` You should have a `form` element with an `id` of `form`."} +{"_id":"q-en-freeCodeCamp-1e348c242b09d78b776fbbcab8bfa79dd5a7ce6c0df51ff3c3c32951c69b19b5","text":"editor.addAction({ id: 'toggle-accessibility', label: 'Toggle Accessibility Mode', keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E], keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E, monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_E ], run: () => { const currentAccessibility = storedAccessibilityMode();"} +{"_id":"q-en-freeCodeCamp-1e43d5a681ecc04ece7608cd30b240e882f9cd3ccc95f930fc5da19ddf3548ee","text":"isDonating } = user; console.log(showDonation); return ( }, \"certification\": { \"certifies\": \"Chinese: This certifies that\", \"completed\": \"Chinese: has successfully completed the freeCodeCamp.org\", \"developer\": \"Chinese: Developer Certification, representing approximately\", \"executive\": \"Chinese: Executive Director, freeCodeCamp.org\", \"verify\": \"Chinese: Verify this certification at {{certURL}}\", \"issued\": \"Chinese: Issued\" } }"} +{"_id":"q-en-freeCodeCamp-22f5affef886eda7a3d067b2abb2ca890b70868fce74cd31cce51217e6306fb6","text":"# --description-- The `border-radius` property accepts up to four values to round the round the top-left, top-right, bottom-right, and bottom-left corners. The `border-radius` property accepts up to four values to round the top-left, top-right, bottom-right, and bottom-left corners. Round the top-left corner of `.three` by 30 pixels, the top-right by 25 pixels, the bottom-right by 60 pixels, and bottom-left by 12 pixels."} +{"_id":"q-en-freeCodeCamp-2361d594ea4537ebbe6267721dc9d43b52968006f1bcfffd9364ab8030f009a1","text":"Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. Required (non-virtual) DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. **User Story #1:** My heat map should have a title with a corresponding `id=\"title\"`."} +{"_id":"q-en-freeCodeCamp-23633968ef84a80965cf39907ffd355144aade98c4957101c95d49d041a13f48","text":"#learn-app-wrapper h2.medium-heading { margin-bottom: 50px; margin-top: 0px; text-align: center; }"} +{"_id":"q-en-freeCodeCamp-23954a7fd47e41d97d15590ca7c5368601b7ea90c663e7327d4d55429cf0149b","text":"\"description\": [ \"In computer science, data structures are things that hold data. JavaScript has seven of these. For example, the Number data structure holds numbers.\", \"Let's learn about the most basic data structure of all: the Boolean. Booleans can only hold the value of either true or false. They are basically little on-off switches.\", \"Let's modify our welcomeToBooleansfunction so that it will return trueinstead of falsewhen the run button is clicked.\" \"Let's modify our welcomeToBooleans function so that it will return true instead of false when the run button is clicked.\" ], \"tests\": [ \"assert(typeof(welcomeToBooleans()) === 'boolean', 'message: The welcomeToBooleans() function should return a boolean (true/false) value.');\","} +{"_id":"q-en-freeCodeCamp-242b7ce8067d85cff2d0e9accbd19cb5b7ffba93dc1a3f3dd4359556c7f4475e","text":"Spreadsheet software typically uses `=` at the beginning of a cell to indicate a calculation should be used, and spreadsheet functions should be evaluated. Update your `if` condition to also check if the first character of `value` is `=`. Use the `&&` operator to add a second condition to your `if` statement that also checks if the first character of `value` is `=`. # --hints-- Your `if` condition should also check if the first character of `value` is `=`. You may use `[0]`, `.startsWith()`, or `.charAt(0)`. You should use the `&&` operator to add a second condition to your `if` statement that also checks if the first character of `value` is `=`. You may use `[0]`, `.startsWith()`, or `.charAt(0)`. ```js assert.match(code, /consts+updates*=s*(?s*events*)?s*=>s*{s*consts+elements*=s*event.target;?s*consts+values*=s*element.value.replace(s*/s/gs*,s*('|\"|`)1s*);?s*ifs*(s*(!value.includes(s*element.ids*)s*&&s*(?:value[0]s*===s*('|\"|`)=3|value.charAt(0)s*===s*('|\"|`)=4|value.startsWith(('|\"|`)=5))|(?:value[0]s*===s*('|\"|`)=6|value.charAt(0)s*===s*('|\"|`)=7|value.startsWith(('|\"|`)=8))s*||s*!value.includes(s*element.ids*))s*)s*{s*}/);"} +{"_id":"q-en-freeCodeCamp-243562d420ce972357db59ab0c2f0faafa93254bd54017f615aa14e90c8347d6","text":"\"description\": [ \"Wir haben also gesehen dass Id Deklarationen die von Klassen überschreiben, egal wo sie in deinem style Element CSS stehen.\", \"Es gibt noch andere Wege CSS zu überschreiben. Erinnerst du dich an Inline Styles?\", \"Benutze in-line style um dein h1 Element weiß zu machen. Vergiss nicht, Inline Styles sehen so aus:\", \"Benutze inline style um dein h1 Element weiß zu machen. Vergiss nicht, Inline Styles sehen so aus:\", \"<h1 style=\"color: green\">\", \"Lasse die blue-text und pink-text Klassen auf deinem h1 Element.\" ]"} +{"_id":"q-en-freeCodeCamp-24578eceb7ec6bf18b1b975a44a02c75ab5879f66a4ae804a5ed4035e14457fa","text":"## Instructions
    In the penguin class, create a variable name --penguin-skin and give it a value of gray In the penguin class, create a variable name --penguin-skin and give it a value of gray.
    ## Tests"} +{"_id":"q-en-freeCodeCamp-254df91b4dd83ed27e6822926cd7e9e3e298a5196828676e59bad120d391f5f7","text":"assert.include(document.querySelector('#author-container > div')?.className, 'user-card'); ``` Your `div` element should have the `id` of `index`. Remember to use template interpolation to set the `id`. Your `div` element should have the `id` of `index`. Remember to use string interpolation to set the `id`. ```js displayAuthors([{author: \"Naomi\"}]);"} +{"_id":"q-en-freeCodeCamp-2665f4ddd6ed620a593accc973cdfc7af01a354c66a206387c6d458894740725","text":"Variable naming follows specific rules: names can include letters, numbers, dollar signs, and underscores, but cannot contain spaces and must not begin with a number. Declare a `character` variable in your code. Use the `let` keyword to declare a variable called `character`. _Note_: It is common practice to end statements in JavaScript with a semicolon. `;`"} +{"_id":"q-en-freeCodeCamp-28c3958eeb1b5ff381f56a3f18d75c41bac64efd6f5858b0a5fbb2d60eed189a","text":"
  • Front End Libraries
  • Data Visualization
  • APIs and Microservices
  • Quality Assurance
  • Legacy Information Security and Quality Assurance
"} +{"_id":"q-en-freeCodeCamp-29dc4bff6316f5f0bf70e425140891b387d57464b771e56d50c2b949d1062962","text":"# --description-- We don't want a player's only weapon to break. The logical or operator checks if two statements are true. We don't want a player's only weapon to break. The logical AND operator checks if two statements are true. Use the logical and operator `&&` to add a second condition to your `if` statement. The player's weapon should only break if `inventory.length` does not equal (`!==`) one. Use the logical AND operator `&&` to add a second condition to your `if` statement. The player's weapon should only break if `inventory.length` does not equal (`!==`) one. Here is an example of an `if` statement with two conditions:"} +{"_id":"q-en-freeCodeCamp-2a2fa599d44eba9bc727f603fe21d6647d23b81181a631abaa4d28af3c79d0a6","text":"`myRegex` should use lazy matching ```js assert(/?/g.test(myRegex)); assert(/[^][*+?]?/.test(myRegex)); ``` `myRegex` should not include the string `h1`"} +{"_id":"q-en-freeCodeCamp-2a81d193059b81d22cf1d0e77659c75adf651d04827573b7cd0697492fb80e65","text":"loadScript(subscription, deleteScript) { if (deleteScript) scriptRemover('paypal-sdk'); let queries = `?client-id=${this.props.clinetId}&disable-funding=credit,card`; let queries = `?client-id=${this.props.clientId}&disable-funding=credit,card`; if (subscription) queries += '&vault=true'; scriptLoader("} +{"_id":"q-en-freeCodeCamp-2bcb8cff59f50dfebe3f32768b4018097ddfeed0ead455932ac796c60635444f","text":"\"Aquí está el código que puedes poner en tu evento de pulsación para lograrlo:\", \"
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
\", \"Una vez lo añadas, pulsa el botón \"Get Message\". Su función Ajax sustituirá el texto \"The message will go here\" con la salida JSON en bruto de la API de fotos de gato de Free Code Camp.\" ], \"namePt\": \"Obter um JSON com o método getJSON do jQuery\", \"descriptionPt\": [ \"Também é possivel solicitar os dados de uma fonte externa. É aqui onde as API's entram em jogo. \", \"Lembre que as API's - Interface de Programação de Aplicativos - são ferramentas que os computadores usam para se comunicar entre si.\", \"A maioria das API's transferem de dados para web em um formato chamado JSON. JSON significa notação de objeto JavaScript (JavaScript Object Notation).\", \"Você já usou JSON para criar objetos em JavaScript. O JSON não é mais que as propriedades de um objeto e seus valores atuais, separados entre { e um }. \", \"Estas propriedades e seus valores são muitas vezes denominados de \" pares chave-valor\".\", \"Vamos obter o JSON da API de fotos de gatos do Free Code Camp.\", \"Aqui esta o código que você pode por no nosso evento de clique para fazer isso:\", \"
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
\", \"Uma vez adicionadas, aperte o botão \"Get Message\". Sua função Ajax substituirá o texto \"The message will go here\" com a saída bruta do JSON da API de gatos do Free Code Camp.\"
] }, {"} +{"_id":"q-en-freeCodeCamp-2bcea5235dd77775c0f6cf2f7551d4b4f5418fc84a25252ec2f6d9ab4d19b8cb","text":"Your `for` loop should use `i < count` as the condition. ```js assert.match(__helpers.removeJSComments(code), /fors*(s*lets+is*=s*0;s*is* assert.match(__helpers.removeJSComments(code), /fors*(s*lets+is*=s*0s*;s*is* ``` # --seed--"} +{"_id":"q-en-freeCodeCamp-2c724729613020706965ec821cebbd21ce5b94bb332db04be6c9d6b3ebdef082","text":"\"Bracket notation is a way to get a character at a specific index within a string.\", \"Computers don't start counting at 1 like humans do. They start at 0.\", \"For example, the character at index 0 in the word \"Charles\" is \"C\". So if var firstName = \"Charles\", you can get the value of the first letter of the string by using firstName[0].\", \"Use bracket notation to find the first character in a the firstLetterOfLastName variable.\", \"Use bracket notation to find the first character in the firstLetterOfLastName variable.\", \"Try looking at the firstLetterOfFirstName variable declaration if you get stuck.\" ], \"tests\": ["} +{"_id":"q-en-freeCodeCamp-2e0dc47e42c1ee5317c7d9794ea24f800404b188ade060b613acb545735cf260","text":" عربي 中文 Português русский Русский Español Ελληνικά "} +{"_id":"q-en-freeCodeCamp-2f285a05a9fe1fdd4811c0ea4dedc05986a46ed3c8be716d3cab944e1f4127fa","text":"\"id\": \"56533eb9ac21ba0edf2244d4\", \"title\": \"Comparison with the Greater Than Operator\", \"description\": [ \"The greater than operator (>) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns true. Otherwise, it returns false.
Like the equality operator, greater than operator will convert data types of values while comparing.\",
\"The greater than operator (>) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns true. Otherwise, it returns false.\", \"Like the equality operator, greater than operator will convert data types of values while comparing.\", \"Examples\", \"
5 > 3 // true
7 > '3' // true
2 > 3 // false
'1' > 9 // false
\", \"

Instructions

\","} +{"_id":"q-en-freeCodeCamp-2fd059b43de8796d3f7d67c92a8f5863cf3f734c2557ca93754d67046134d996","text":"const mapStateToProps = createSelector( userSelector, user => ({ ...user.profileUI, user }) );"} +{"_id":"q-en-freeCodeCamp-3023cc36b6065718535946b655b8ad9354a4bf99260a05caadda02a4282fe1fc","text":"], \"helpRoom\": \"Help\", \"fileName\": \"01-responsive-web-design/basic-css.json\" } No newline at end of file } "} +{"_id":"q-en-freeCodeCamp-3056538c6935e04f95b0b4340103ee8f5c6e27ea73b4821096ebb21eecd45a8c","text":"// when non-empty search input submitted return query ? window.location.assign( `https://freecodecamp.org/news/search/?query=${encodeURIComponent( `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent( query )}` )"} +{"_id":"q-en-freeCodeCamp-30690fa906ade1cbc89e8622ce1e4f9d521b425e51334c0577b5f59535aa3c85","text":"You can help expand them and make their wording better. You can also update the user stories to explain the concept better or remove redundant ones and improve the challenge tests to make them more accurately test people's code. **If you're interested in improving these coding challenges, here's [how to work on coding challenges](/how-to-work-on-coding-challenges.md).** **If you're interested in improving these coding challenges, here's [how to work on coding challenges](how-to-work-on-coding-challenges.md).** ### Learning Platform"} +{"_id":"q-en-freeCodeCamp-31316a42d2433ed8e2d8cb9eff98b14b45c2091149f8ad87b30e7e2a77d6e725","text":"assert.match(attack.toString(), /ifs*(Math.random()s*<=s*.1/); ``` You should use the logical and operator `&&`. You should use the logical AND operator `&&`. ```js assert.match(attack.toString(), /ifs*(Math.random()s*<=s*.1s*&&/); ``` You should use the logical and operator to check if `inventory.length` does not equal `1`. You should use the logical AND operator to check if `inventory.length` does not equal `1`. ```js assert.match(attack.toString(), /ifs*(Math.random()s*<=s*.1s*&&s*inventory.lengths*!==s*1s*)/);"} +{"_id":"q-en-freeCodeCamp-31725c62c09c8d1665118bcebdd8b24a36d9549e4e3317c18c834b5eff4b9768","text":" import { FastifyPluginCallbackTypebox, Type } from '@fastify/type-provider-typebox'; type Endpoints = [string, 'GET' | 'POST'][]; export const endpoints: Endpoints = [ ['/refetch-user-completed-challenges', 'POST'], ['/certificate/verify-can-claim-cert', 'GET'], ['/api/github', 'GET'] ]; export const deprecatedEndpoints: FastifyPluginCallbackTypebox = ( fastify, _options, done ) => { endpoints.forEach(([endpoint, method]) => { fastify.route({ method, url: endpoint, schema: { response: { 410: Type.Object({ message: Type.Object({ type: Type.Literal('info'), message: Type.Literal( 'Please reload the app, this feature is no longer available.' ) }) }) } }, handler: async (_req, reply) => { void reply.status(410); return { message: { type: 'info', message: 'Please reload the app, this feature is no longer available.' } } as const; } }); }); done(); }; "} +{"_id":"q-en-freeCodeCamp-377b1be1b17b8fc334ebba8d29910c0761098bcf65a16604c94c6cb04513e22d","text":"} const propTypes = { clinetId: PropTypes.string, clientId: PropTypes.string, createOrder: PropTypes.func, createSubscription: PropTypes.func, donationAmount: PropTypes.number,"} +{"_id":"q-en-freeCodeCamp-377ccad437ddb4ae617c8b3c8af9afd13b74b4cc3b85342a18cc2dced4d72d9e","text":".col-xs-12.col-sm-9.col-md-10 li.large-p.faded.negative-10 a(href='#' + challengeBlock.dashedName)= challengeBlock.name h3= challengeBlock else .hidden-xs.col-sm-3.col-md-2 .progress.progress-bar-padding.text-center.thin-progress-bar"} +{"_id":"q-en-freeCodeCamp-388e036c49b0867bc731635b9b479d203b612c646382f97b35da3fccd1986aef","text":"\"id\": \"bad87fee1348bd9aedf07756\", \"title\": \"Override All Other Styles by using Important\", \"description\": [ \"Yay! We just proved that in-line styles will override all the CSS declarations in your style element.\", \"Yay! We just proved that inline styles will override all the CSS declarations in your style element.\", \"But wait. There's one last way to override CSS. This is the most powerful method of all. But before we do it, let's talk about why you would ever want to override CSS.\", \"In many situations, you will use CSS libraries. These may accidentally override your own CSS. So when you absolutely need to be sure that an element has specific CSS, you can use !important\", \"Let's go all the way back to our pink-text class declaration. Remember that our pink-text class was overridden by subsequent class declarations, id declarations, and in-line styles.\", \"Let's go all the way back to our pink-text class declaration. Remember that our pink-text class was overridden by subsequent class declarations, id declarations, and inline styles.\", \"Let's add the keyword !important to your pink-text element's color declaration to make 100% sure that your h1 element will be pink.\", \"An example of how to do this is:\", \"color: red !important;\""} +{"_id":"q-en-freeCodeCamp-38a6a802464e3445a100d1fdf71b80962adc622af86095c67fa71dfb0dfd2464","text":"dragAndDrop: true, lightbulb: { enabled: false } }, quickSuggestions: false }; this._editor = null;"} +{"_id":"q-en-freeCodeCamp-39f12b41e850ff046c7922c4838684da3248aea8cdab8c0a4b35526bbf0a8248","text":"# --description-- Inside the `case` for `mm-dd-yyyy-h-mm`, set the `textContent` property of `currentDateParagraph` to `${month}-${day}-${year} ${hours} Hours ${minutes} Minutes`. When the user selects the `Month, Day, Year, Hours, Minutes` option from the dropdown, you need to display the date in the format `mm-dd-yyyy h Hours m Minutes`. Inside the `case` for `mm-dd-yyyy-h-mm`, use string interpolation to assign the formatted date from above to the `textContent` property of `currentDateParagraph`. Make sure to use the `month`, `day`, `year`, `hours`, and `minutes` variables in your answer. # --hints-- You should assign `${month}-${day}-${year} ${hours} Hours ${minutes} Minutes` to the `textContent` property of `currentDateParagraph`. Your answer should follow this format: `mm-dd-yyyy h Hours m Minutes`. Replace `mm`, `dd`, `yyyy`, `h`, and `m` with the `month`, `day`, `year`, `hours`, and `minutes` variables you created earlier. ```js const pattern = /cases*('|\")mm-dd-yyyy-h-mm1s*:s*currentDateParagraph.textContents*=s*`(${month}-${day}-${year} ${hours} Hours ${minutes} Minutes)`/;"} +{"_id":"q-en-freeCodeCamp-3a1a7de49218b7ff7cb02deb291d8c75461c94661a87e53b08df5f56c68bb5ef","text":"testString: myRegex.lastIndex = 0; assert(myRegex.test('Eleanor Roosevelt')); - text: Your regex myRegex should return false for the string Franklin Rosevelt testString: myRegex.lastIndex = 0; assert(!myRegex.test('Franklin Rosevelt')); - text: Your regex myRegex should return false for the string Frank Roosevelt testString: myRegex.lastIndex = 0; assert(!myRegex.test('Frank Roosevelt')); - text: You should use .test() to test the regex. testString: assert(code.match(/myRegex.test(s*myStrings*)/)); - text: Your result should return true."} +{"_id":"q-en-freeCodeCamp-3ab189227bfaac4575acc24937339819e93deadb178a20b0bc0a5c7b02344028","text":"

Quincy Larson

Executive Director, freeCodeCamp.org

{t('certification.executive')}

Verify this certification at {certURL}

{t('certification.verify', { certURL: certURL })}

"} +{"_id":"q-en-freeCodeCamp-3afc68c630c4904822ff4b9a53b7541803dd62d70f492d9e528c0be6932f4a2e","text":"render() { const { duration, planId, amount } = this.state; const isSubscription = duration !== 'onetime'; if (!paypalClientId) { return null; } return ( clinetId={paypalClientId}
clientId={paypalClientId} createOrder={(data, actions) => { return actions.order.create({ purchase_units: ["} +{"_id":"q-en-freeCodeCamp-3bf98d09f7eba8617b9fdfd263136756150f79fcf5e1f33c4e75355128dd993c","text":"except: continue if len(exp_ball_list_copy) == 0: success += 1 probability = success/num_experiments success += 1 probability = success/num_experiments return probability ```"} +{"_id":"q-en-freeCodeCamp-3c7803ef1f580ce90a4056afae1d14088bec9789b889f09263644c5973d3ce05","text":"{ objectID: `default-hit-${searchQuery}`, query: searchQuery, url: `https://freecodecamp.org/news/search/?query=${encodeURIComponent( url: `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent( searchQuery )}`, title: `See all results for ${searchQuery}`,"} +{"_id":"q-en-freeCodeCamp-3e1e080a6f908753d1f81252315f22f348d9eee07250b08426585bcd27d796eb","text":"Your code should have two `meta` elements. ```js assert(code.match(//g).length === 2); assert(code.match(//g).length === 2); ``` Your `meta` element should have a `name` attribute with a value of `viewport`."} +{"_id":"q-en-freeCodeCamp-3eac9dae7fd8bcb8dd595e84c86603291b3d7a3d7c48e9d97dbefaf70370a688","text":") return drawn def experiment(hat, expected_balls, num_balls_drawn, num_experiments): def experiment(hat, expected_balls, num_balls_drawn, num_experiments): expected_balls_list = [] drawn_list = [] success = 0"} +{"_id":"q-en-freeCodeCamp-40828b02eae4af827106c0d2e79672cc81416df7913302cb619de6b8dad5a480","text":"Typeface plays an important role in the accessibility of a page. Some fonts are easier to read than others, and this is especially true on low-resolution screens. Change the font for both the `h1` and `h2` elements to `Verdana`, and use another sans-serif _web safe_ font as a fallback. Change the font for both the `h1` and `h2` elements to `Verdana`, and use another web-safe font in the sans-serif family as a fallback. Also, add a `border-bottom` of `4px solid #dfdfe2` to `h2` elements to make the sections distinct."} +{"_id":"q-en-freeCodeCamp-41822624089ad8b392929bbbc5733d2d09b34a21065de6c07c2f601bfb170843","text":"id: 'execute-challenge', label: 'Run tests', /* eslint-disable no-bitwise */ keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter], keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, monaco.KeyMod.WinCtrl | monaco.KeyCode.Enter ], run: () => { if (props.usesMultifileEditor && !isFinalProject(props.challengeType)) { if (challengeIsComplete()) {"} +{"_id":"q-en-freeCodeCamp-41ab65d3fbbb815f545a2c61463ae471b214ec88f313ddbd209e24e053208278","text":"testString: 'assert(checkObj({city: \"Seattle\"}, \"city\") === \"Seattle\");' - text: 'checkObj({city: \"Seattle\"}, \"district\") should return \"Not Found\".' testString: 'assert(checkObj({city: \"Seattle\"}, \"district\") === \"Not Found\");' - text: 'checkObj({pet: \"kitten\", bed: \"sleigh\"}, \"gift\") should return \"Not Found\".' testString: 'assert(checkObj({pet: \"kitten\", bed: \"sleigh\"}, \"gift\") === \"Not Found\");' ``` "} +{"_id":"q-en-freeCodeCamp-422b7b731c2be16583751f2552d7f005f207bf536410ecebf4d827b2faa2184c","text":"```js // multiplies the first input value by the second and returns it const multiplier = (item, multi) => item * multi; multiplier(4, 2); // returns 8 ``` "} +{"_id":"q-en-freeCodeCamp-4315f1d4d55a1ffc13affa777cdf6178c5dfdf384b1f68edd0b1c04849c012b3","text":"void fastify.register(devLoginCallback, { prefix: '/auth' }); } void fastify.register(settingRoutes); void fastify.register(deprecatedEndpoints); return fastify; };"} +{"_id":"q-en-freeCodeCamp-4457a792509374fb5e348eb147f2e4bee40c17f71b5e4ddcf35f120691c63af1","text":"selectionHighlight: false, overviewRulerBorder: false, hideCursorInOverviewRuler: true, renderIndentGuides: false, renderIndentGuides: props.challengeType === challengeTypes.python, minimap: { enabled: false },"} +{"_id":"q-en-freeCodeCamp-44b695b89c3a3937e6d2a311626c48aaacfb1a55faf3a1df87b82b61baaf296b","text":"editor.addAction({ id: 'save-editor-content', label: 'Save editor content', keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S], keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_S ], run: props.challengeType === challengeTypes.multifileCertProject && props.isSignedIn"} +{"_id":"q-en-freeCodeCamp-4799c55aecb8b296f99794f82f88f2cda16187b344cb8470a0b0534ecabfffb6","text":"## Instructions
Combine the two if statements into one statement which will return \"Yes\" if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return \"No\". Replace the two if statements with one statement, using the && operator, which will return \"Yes\" if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return \"No\".
## Tests"} +{"_id":"q-en-freeCodeCamp-4b01435667e3b5b90f05f44e64a10f4769b64104fbe55c3a4589eca37960caf9","text":"(data) => { assert.match( data, /passport.use.*new GitHubStrategy/gi, /passport.use.*new GitHubStrategy/gis, 'Passport should use a new GitHubStrategy' ); assert.match("} +{"_id":"q-en-freeCodeCamp-4cfed05b3fe6d211e879b43ce52a7fe05e660d759ec5036873a986538104652c","text":"In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any 1.3.x version. To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. ```json \"package\": \"~1.3.8\""} +{"_id":"q-en-freeCodeCamp-4e083542efbc772f0c7aa550ccf02883e31df8d75e1718809d03bd0723b3541c","text":"When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field. The `package.json` file is the center of any Node.js project or npm package. It stores information about your project, similar to how the <head> section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; \"name\" and \"version\", but it’s good practice to provide additional information about your project that could be useful to future users or maintainers. The `package.json` file is the center of any Node.js project or npm package. It stores information about your project, similar to how the `head` section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information about your project that could be useful to future users or maintainers. If you look at the file tree of your project, you will find the package.json file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project."} +{"_id":"q-en-freeCodeCamp-4e1de396b84473e7c41dbab3e3dc99ab8493397079467e591bd163f758946f2f","text":"onChange={this.handleChange} onFocus={this.handleFocus} onSubmit={this.handleSearch} showLoadingIndicator={true} showLoadingIndicator={false} translations={{ placeholder }} /> "} +{"_id":"q-en-freeCodeCamp-50ad1839d8985b7059ff9d8c6a169b177164d09d45e5c016e447f0c44705e521","text":"componentDidMount() { this.props.updateProjectForm({}); } componentDidUpdate() { this.props.updateProjectForm({}); } componentWillUnmount() { this.props.updateProjectForm({}); } handleSubmit(values) { this.props.updateProjectForm(values); this.props.onSubmit();"} +{"_id":"q-en-freeCodeCamp-514550a1dd66a2becef8631b751d210358fb5787d487c773b4ae9262caa07ca2","text":"height: 100%; width: 100%; } .CodeMirror-lint-tooltip { z-index: 9999; } No newline at end of file"} +{"_id":"q-en-freeCodeCamp-51dc70d904ceae3ab78361aa06c52a96cc2ef1748468db9f69fad0cb48a446fc","text":"\"Hagamos que cuando un usuario pulse el botón \"Get Message\", el texto del elemento con la clase message cambie para decir \"Here is the message\".\", \"Podemos hacerlo añadiendo el siguiente código dentro de nuestro evento de pulsación:\", \"$(\".message\").html(\"Here is the message\");\" ], \"namePt\": \"Mundando texto com eventos de clique\", \"descriptionPt\": [ \"Quando nosso evento de clique ocorre, podemos utilizar o Ajax para atualixar um elemento HTML\", \"Vamos fazer que quando um usuário clicar no botão \"Get Message\", o texto do elemento com a classe message passe a dizer \"Here is the message\".\", \"Podemos fazer isso adicionando o seguinte código dentro do nosso evento de clique:\", \"$(\".message\").html(\"Here is the message\");\" ] }, {"} +{"_id":"q-en-freeCodeCamp-52c36d0cb49026c6e252e7b9df71672889ec5f8ae22712cf9d761764e3780348","text":"transform: translateY(-50%); } .landing-skill-icon { color: #215f1e; font-size: 150px; } .black-text { color: #333; font-weight: 400; font-size: 40px; } .font-awesome-padding { margin-top: 45px; margin-bottom: 20px; } .background-svg { width: 220px; height: 220px;"} +{"_id":"q-en-freeCodeCamp-53bef0bfb230260c32916879e28837cd1f59e0199e7b97398a9d0930172992da","text":"\"invalid-protocol\": \"La URL debe comenzar con http o https\", \"url-not-image\": \"URL debes enlazar directamente a un archivo de imagen\", \"use-valid-url\": \"Utiliza un URL válido\" }, \"certification\": { \"certifies\": \"Spanish: This certifies that\", \"completed\": \"Spanish: has successfully completed the freeCodeCamp.org\", \"developer\": \"Spanish: Developer Certification, representing approximately\", \"executive\": \"Spanish: Executive Director, freeCodeCamp.org\", \"verify\": \"Spanish: Verify this certification at {{certURL}}\", \"issued\": \"Spanish: Issued\" } }"} +{"_id":"q-en-freeCodeCamp-5514e221ee48a3d221fae75d82fd1c72ad9109a47e1322283be5720244fefd9d","text":"Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. Your current version of `@freecodecamp/example` should be \"~1.2.13\" which allows npm to install to the latest 1.2.x version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any 1.x.x version. Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. ```json \"package\": \"^1.3.8\" ``` This would allow updates to any 1.x.x version of the package. This would allow updates to any `1.x.x` version of the package. # --instructions--"} +{"_id":"q-en-freeCodeCamp-5618492c5544ad9db3f4d6c3597a0f5018798e788e4b59ad3fc29028d3db92d9","text":"\"Here are the user stories you must enable, and optional bonus user stories:\", \"User Story: As a user, I can access all of the portfolio webpage's content just by scrolling.\", \"User Story: As a user, I can click different buttons that will take me to the portfolio creator's different social media pages.\", \"User Story: As a user, I can see thumbnail images of different projects the portfolio creator has built (if you don't haven't built any websites before, use placeholders.)\", \"User Story: As a user, I can see thumbnail images of different projects the portfolio creator has built (if you haven't built any websites before, use placeholders.)\", \"Bonus User Story: As a user, I navigate to different sections of the webpage by clicking buttons in the navigation.\", \"Don't worry if you don't have anything to showcase on your portfolio yet - you will build several several apps on the next few CodePen challenges, and can come back and update your portfolio later.\", \"There are many great portfolio templates out there, but for this challenge, you'll need to build a portfolio page yourself. Using Bootstrap will make this much easier for you.\","} +{"_id":"q-en-freeCodeCamp-56223da06b08bde6d7e24b5f6ee89ef19eea19d1e1baff44f625b2cc1f05c7ba","text":"max-height: 100%; font-size: 27px; white-space: normal; width: 100%; } .default-layout {"} +{"_id":"q-en-freeCodeCamp-59bd1b5c934fad72263c5a05eae8995e4f65ea5de13d320feb9ffa5b7c1dc603","text":"reload(probability_calculator) probability_calculator.random.seed(95) def test_hat_draw(self): class UnitTests(unittest.TestCase): maxDiff = None def test_hat_draw(self): hat = probability_calculator.Hat(red=5,blue=2) actual = hat.draw(2) expected = ['blue', 'red']"} +{"_id":"q-en-freeCodeCamp-5a0f8e8cbf4a667d9f1c3328b9c0d2f597dfa46f9bb79a192bc7fe59e94eea02","text":"{currentCertTitles.map(title => ( ))} {t('settings.headings.legacy-certs')} {legacyCertTitles.map(title => ("} +{"_id":"q-en-freeCodeCamp-5cb615338fcb8302f75d5ce15a360adfc4a7c7902ec3e12247ce9db8c01e81b6","text":"h4.negative-10.text-nowrap Live Content Manager img.profile-image(src='https://s3.amazonaws.com/freecodecamp/jason-rueckert.jpg' alt=\"Jason Rueckert's picture\") h4.text-nowrap Seattle, Washington p.negative-10 \"My high school job was testing basketball shoes for Nike. I learned code to work smarter, not harder. I have no thyroid.\" No newline at end of file p.negative-10 \"My high school job was testing basketball shoes for Nike. I learned code to work smarter, not harder. I have no thyroid.\" "} +{"_id":"q-en-freeCodeCamp-5e319515b5e237da32789e4bed9ab54cfe9c4e78d26a0ed6e616e270f64aa34c","text":" `, { runScripts: 'dangerously', virtualConsole virtualConsole, url: 'http://localhost' }); const { window } = dom;"} +{"_id":"q-en-freeCodeCamp-5ef7dedf806b7fdb07c5f693505e991a4526e3340503b2f25c1d37214bc2508f","text":"The attack of the monster will be based on the monster's `level` and the player's `xp`. In the `getMonsterAttackValue` function, use `const` to create a variable called `hit`. Assign it the equation `(level * 5) - (Math.floor(Math.random() * xp));`. This will set the monster's attack to five times their `level` minus a random number between 0 and the player's `xp`. This will set the monster's attack to five times their `level` minus a random number between `0` and the player's `xp`. # --hints--"} +{"_id":"q-en-freeCodeCamp-5f5dea838d64144373c7fd9630e7b7f489d7dfd036f70ee510e0eb9d6a05b77c","text":"import { omit } from 'lodash-es'; import { call, delay, put, select, takeLatest, takeEvery takeEvery, debounce } from 'redux-saga/effects'; import { createFlashMessage } from '../../components/Flash/redux';"} +{"_id":"q-en-freeCodeCamp-63ef97f58b671d301e2634f10954e8aa57a2669281218fe2e30600a301da2369","text":"], \"tests\": [ \"assert($(\"i\").hasClass(\"fa fa-thumbs-up\"), 'Add an i element with the classes fa and fa-thumbs-up.')\", \"assert($(\"i.fa-thumbs-up\").parent().text().match(/Like/gi), 'Your fa-thumbs-up icon should be located within the Like button.')\", \"assert($(\"button\").children(\"i\").length > 0, 'Nest your i element within your button element.')\", \"assert(editor.match(//g), 'Make sure your i element has a closing tag.')\" ],"} +{"_id":"q-en-freeCodeCamp-643fa548c3268814b7db2ab638c2b53f36d4c33f936b68a574a62bb48c6e96af","text":"Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. Required (non-virtual) DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. **User Story #1:** My choropleth should have a title with a corresponding `id=\"title\"`."} +{"_id":"q-en-freeCodeCamp-644ea9d4a69a59d02b33151122423735fba78958d17eba95b34068acb71f4e31","text":"\"i means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.\", \"Regular expressions are written by surrounding the pattern with / symbols.\", \"Let's try selecting all the occurrences of the word and in the string Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it.\", \"We can do this by replacing the . part of our regular expression with the current regular expression with the word and.\" \"We can do this by replacing the . part of our regular expression with the word and.\" ], \"tests\": [ \"assert(test==2, 'message: Your regular expression should find two occurrences of the word and.');\","} +{"_id":"q-en-freeCodeCamp-66a806fc80f35bef2db7dc8562a140fc419a4689dfc938186faeced016b5d193","text":"- text: Your code should use the map method. testString: assert(code.match(/.map/g)); - text: ratings should equal [{\"title\":\"Inception\",\"rating\":\"8.8\"},{\"title\":\"Interstellar\",\"rating\":\"8.6\"},{\"title\":\"The Dark Knight\",\"rating\":\"9.0\"},{\"title\":\"Batman Begins\",\"rating\":\"8.3\"},{\"title\":\"Avatar\",\"rating\":\"7.9\"}]. testString: assert(JSON.stringify(ratings) === JSON.stringify([{\"title\":\"Inception\",\"rating\":\"8.8\"},{\"title\":\"Interstellar\",\"rating\":\"8.6\"},{\"title\":\"The Dark Knight\",\"rating\":\"9.0\"},{\"title\":\"Batman Begins\",\"rating\":\"8.3\"},{\"title\":\"Avatar\",\"rating\":\"7.9\"}])); testString: assert.deepEqual(ratings, [{\"title\":\"Inception\",\"rating\":\"8.8\"},{\"title\":\"Interstellar\",\"rating\":\"8.6\"},{\"title\":\"The Dark Knight\",\"rating\":\"9.0\"},{\"title\":\"Batman Begins\",\"rating\":\"8.3\"},{\"title\":\"Avatar\",\"rating\":\"7.9\"}]); ```"} +{"_id":"q-en-freeCodeCamp-674e33ed6c462a38d6031bd8f7fb0963aa578c20e9d0da0e197ea831f0c313ee","text":"describe('', () => { it('should apply striped bg color to every odd element', () => { render(
); render(
); const table = screen.getByTestId('test'); const table = screen.getByRole('table'); const oddTableRowClass = '[&>tbody>tr:nth-of-type(odd)]:bg-background-tertiary'; expect(table).toHaveClass(oddTableRowClass); }); it('should apply the condensed to
and elements', () => { render(); render(
); const table = screen.getByTestId('test'); const table = screen.getByRole('table'); const tableDataClass = '[&_td]:p-1 '; const tableHeaderClass = '[&_th]:p-1';"} +{"_id":"q-en-freeCodeCamp-6a15c7903e70a5d8bec2878af0bb790311a536ec018dac84f7785c13fc134df1","text":"--- # --description-- In your `highPrecedence` function, declare a variable using `const` and assign it a regex that checks if the string passed to the `str` parameter matches the pattern of a number followed by a `*` or `/` operator followed by another number. In your `highPrecedence` function, declare a `regex` variable. Assign it a regular expression that matches a number (including decimal numbers) followed by a `*` or `/` operator followed by another number. Each number, and the operator, should be in separate capture groups. Incorporate the regular expression you've defined into your `highPrecedence` function to test if the provided string `str` matches the pattern. Use the `test()` method on your `regex` variable and return the result. Your function should return a boolean value. Remember that you can use the `test()` method for this. # --hints-- You should declare a `regex` variable in your `highPrecedence` function. You should declare a variable in your `highPrecedence` function for your regex. ```js assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*(?:const|let|var)s+regex/); assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*(?:const|let|var)s+w+/); ``` You should use `const` to declare your `regex` variable. You should use `const` to declare your regex variable. ```js assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+regex/); assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+w+/); ``` Your `regex` variable should be a regular expression. Your regex variable should contain a regular expression. ```js assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+regexs*=s*//); assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+w+s*=s*//); ``` Your highPrecedence should return `regex.test(str);` Your `highPrecedence` function should return a boolean value. ```js assert.match(code, /returns+regex.test(str);?/); assert.isBoolean(highPrecedence(\"12*2\")); ``` Please enter a properly functioning regex. Your `highPrecedence` function should correctly check if the string matches the pattern of a number followed by a `*` or `/` operator followed by another number. ```js assert.strictEqual(highPrecedence(\"5*3\"), true); assert.isTrue(highPrecedence(\"5*3\")); assert.isFalse(highPrecedence(\"5\")); assert.isTrue(highPrecedence(\"10/2\")); assert.isFalse(highPrecedence(\"*\")); ``` # --seed--"} +{"_id":"q-en-freeCodeCamp-6c6f5abbb26ea0eaef784484d3ec873b373b7f5a21cc79cf4a04860e2ea356d8","text":"\"Cuando estamos recorriendo estos objetos, usemos esta propiedad imageLink para visualizar la imagen en un elemento img.\", \"Aquí está el código que hace esto:\", \"html += \"<img src = '\" + val.imageLink + \"'>\";\" ], \"namePt\": \"Apresentar as imagens da fonte de dados\", \"descriptionPt\": [ \"Como temos visto nas ultimas lições, cada objeto em nosso array JSON contém a chave imageLink com um valor que corresponde a url da imagem de um gato.\", \"Quando estamos percorrendo por estes objetos, usamos a propriedade imageLink para visualizar a imagem em um elemento img.\", \"Aqui está o código para fazer isso:\", \"html += \"<img src = '\" + val.imageLink + \"'>\";\" ] }, {"} +{"_id":"q-en-freeCodeCamp-6cb490d277e4e8818213e493408dd74fd2cbb6f92efa9e06e34f65bf2e5e316b","text":"return (

{name ? 'Welcome back, ' + name + '.' : 'Welcome to freeCodeCamp.org'} {name ? `Welcome back, ${name}.` : `Welcome to freeCodeCamp.org`}

"} +{"_id":"q-en-freeCodeCamp-74c10be5dad5285bfa395b6c0c92436f45a0f892f11f281214cc6d6eaf618fba","text":"const count = 8; const rows = []; --fcc-editable-region-- function padRow() { } --fcc-editable-region-- padRow(); --fcc-editable-region--"} +{"_id":"q-en-freeCodeCamp-76b0c1849a1bb1baedd510a4a3030f4bcac513bb137a83d1d6bbac27b02fbeaa","text":"\"Después, iteremos a traveś de nuestro JSON, añadiendo más HTML a esa variable. Cuando se termina el ciclo, vamos a presentarla. \", \"Aquí está el código que hace esto:\", \"
json.forEach(function(val) {
var keys = Object.keys(val);
html += \"<div class = 'cat'>\";
keys.forEach(function(key) {
html += \"<b>\" + key + \"</b>: \" + val[key] + \"<br>\";
});
html += \"</div><br>\";
});
\" ], \"namePt\": \"Converter dados JSON para HTML\", \"descriptionPt\": [ \"Agora que estamos obtendo os dados de uma API JSON, vamos mostra-los em nosso HTML\", \"Podemos usar o método .forEach() para percorrer os nossos dados e modificar o elementos HTML.\", \"Em primeiro lugar, vamos declarar uma variável chamada html com var html = \"\";.\", \"Depois, vamos percorrer através do nosso JSON, adicionando mais HTML para a nossa variável. Quando essa iteração terminar, vamos apresentar o resultado.\", \"Aqui está o código que faz isso:\", \"
json.forEach(function(val) {
var keys = Object.keys(val);
html += \"<div class = 'cat'>\";
keys.forEach(function(key) {
html += \"<b>\" + key + \"</b>: \" + val[key] + \"<br>\";
});
html += \"</div><br>\";
});
\"
] }, {"} +{"_id":"q-en-freeCodeCamp-76ff868e2fb9983e82d6c81869b8fbae2246072e67a0b39bac40ce48401f800a","text":"\"assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');\", \"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');\", \"assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);\", \"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th, 2016']);\", \"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'one month apart can be inferred it is the same year');\", \"assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');\", \"assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023']);\" ],"} +{"_id":"q-en-freeCodeCamp-77b2e2d2823ae18b3eddb0b7bcab16b09f876bc4746c69279a35ab722ce62eb0","text":"- text: The value of remainder should be 2 testString: assert(remainder === 2); - text: You should use the % operator testString: assert(/s+?remainders*?=s*?.*%.*;/.test(code)); testString: assert(/s+?remainders*?=s*?.*%.*;?/.test(code)); ```"} +{"_id":"q-en-freeCodeCamp-7914cc5f8da3e379adfe2d102637d7f194580ab6babbaa87a19c29bdd851a7fd","text":"# --description-- Following the same pattern, use that code in the `fightBeast` and `fightDragon` functions. Remember that `beast` is at index `1` and `dragon` is at index `2`. Also, remove the `console.log` call from your `fightDragon` function. Following the same pattern as the `fightSlime` function, use that code in the `fightBeast` and `fightDragon` functions. Remember that `beast` is at index `1` and `dragon` is at index `2`. Also, remove the `console.log` call from your `fightDragon` function. # --hints--"} +{"_id":"q-en-freeCodeCamp-7a5b14a92e4f681d1bf3589a2caa3385f20c4bc989386529399a4b680e447b4c","text":"import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { Button, Form } from '@freecodecamp/react-bootstrap'; import { isEqual } from 'lodash'; import { userSelector } from '../../redux'; import { submitProfileUI } from '../../redux/settings';"} +{"_id":"q-en-freeCodeCamp-7b96a1fd6254002bca9bd99a4d8e54ddadb4f6b9df0c4b588fb16916994c1057","text":"br br a.btn.nonprofit-cta.btn-success(href=\"/nonprofits\") I'm with a nonprofit and want help coding something include partials/about include partials/faq No newline at end of file .big-break h2 Campers you'll hang out with: .row .col-xs-12.col-sm-12.col-md-4 img.img-responsive.testimonial-image.img-center(src=\"https://s3.amazonaws.com/freecodecamp/testimonial-jen.jpg\", alt=\"@jenthebest's testimonial image\") .testimonial-copy Getting back on track with Free Code Camp and committing to a new career in 2015! h3 - @jenthebest .col-xs-12.col-sm-12.col-md-4 img.img-responsive.testimonial-image.img-center(src=\"https://s3.amazonaws.com/freecodecamp/testimonial-tate.jpg\", alt=\"@TateThurston's testimonial image\") .testimonial-copy Just built my company's website with skills I've learned from Free Code Camp! h3 - @TateThurston .col-xs-12.col-sm-12.col-md-4 img.img-responsive.testimonial-image.img-center(src=\"https://s3.amazonaws.com/freecodecamp/testimonial-cynthia.jpg\", alt=\"@cynthialanel's testimonial image\") .testimonial-copy I'm currently working through Free Code Camp to improve my JavaScript. The community is very welcoming! h3 - @cynthialanel .big-break h2 Skills you'll learn: .text-center .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-html5 .black-text HTML5 .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-css3 .black-text CSS3 .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-javascript .black-text JavaScript .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.fa.fa-database.font-awesome-padding .black-text Databases .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-chrome .black-text DevTools .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-nodejs .black-text Node.js .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-angular .black-text Angular.js .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-ios-loop-strong .black-text Agile .big-break h2   h2 Fast facts about our community: h3.col-xs-offset-0.col-sm-offset-1.col-md-offset-2 ul.text-left li.ion-code   We're 100% free and open source li.ion-code   We're thousands of professionals who are learning to code li.ion-code   We're building projects for dozens of nonprofits li.ion-code   We share one goal: to boost our careers with code .big-break a.btn.btn-cta.signup-btn(href=\"/login\") Start learning to code (it's free) No newline at end of file"} +{"_id":"q-en-freeCodeCamp-7ce3f2fb6b1fe78ed17b317baf0d1e9c73351eb2ae086c9bcad413d21bbdaf1d","text":"Essentially, we expect basic familiarity with some of the aforementioned technologies, tools, and libraries. With that being said, you are not required to be an expert on them to contribute. **If you want to help us improve our codebase, you can either [set up freeCodeCamp locally](/how-to-setup-freecodecamp-locally.md)** **If you want to help us improve our codebase, you can either [set up freeCodeCamp locally](how-to-setup-freecodecamp-locally.md)** OR"} +{"_id":"q-en-freeCodeCamp-7d02002468abf7407c55605e6849503f681e424b103ab30dc4631826ccddf336","text":"const url = new URL(val); const topDomain = url.hostname.split('.').slice(-2); if (topDomain.length === 2) { return topDomain.join('.') === domain; return Array.isArray(domain) ? domain.some(d => topDomain.join('.') === d) : topDomain.join('.') === domain; } return false; } catch (e) {"} +{"_id":"q-en-freeCodeCamp-7db1eb3b3a2855bd4f8b4daed8555fa3691cc11bd0b913da6bacb81f50acc94c","text":"\"Si lo permites, verás que el texto en el teléfono de la derecha cambiará con tu latitud y longitud\", \"Aquí hay un código que hace esto:\", \"
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);
});
}
\" ], \"namePt\": \"Receber dados de Geo-localização\", \"descriptionPt\": [ \"Outra coisa interessante que podemos fazer é acessar a atual localização do nosso usuário. Todos os navegadores tem implementado um geo-localizador que pode nos fornecer essa informação.\", \"O navegador pode obter a longitude e latitude atual de nossos usuários\", \"Você irá ver uma janela para bloquear ou permitir que o site possa conhecer a nossa localização atual. O desafio será completado de qualquer maneira, sempre que o código estará correto.\", \"Se você permitir, irá ver o texto de saída do telefone mudar para sua latitude e longitude.\", \"Aqui está o código para fazer isso:\", \"
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);
});
}
\"
] } ]"} +{"_id":"q-en-freeCodeCamp-7e14372497e932fa972517f23f3140828afcbe54320128eaa588a81625474dc7","text":" --- id: 5a9d7295424fe3d0e10cad14 title: Cascading CSS variables challengeType: 0 videoUrl: 'https://scrimba.com/c/cyLZZhZ' --- ## Description
When you create a variable, it is available for you to use inside the element in which you create it. It also is available for any elements nested within it. This effect is known as cascading. Because of cascading, CSS variables are often defined in the :root element. :root is a pseudo-class selector that matches the root element of the document, usually the html element. By creating your variables in :root, they will be available globally and can be accessed from any other selector later in the style sheet.
## Instructions
Define a variable named --penguin-belly in the :root selector and give it the value of pink. You can then see how the value will cascade down to change the value to pink, anywhere that variable is used.
## Tests
```yml tests: - text: Declare the --penguin-belly variable in the :root and assign it to pink. testString: assert(code.match(/:roots*?{[sS]*--penguin-bellys*?:s*?pinks*?;[sS]*}/gi), 'Declare the --penguin-belly variable in the :root and assign it to pink.'); ```
## Challenge Seed
```html
```
## Solution
```js var code = \":root {--penguin-belly: pink;}\" ```
"} +{"_id":"q-en-freeCodeCamp-7e75cde1127be419e69de50aa420efdb76649dc3585f42e85998dba3e270d909","text":"[settingsTypes.updateUserFlagComplete]: (state, { payload }) => payload ? spreadThePayloadOnUser(state, payload) : state, [settingsTypes.verifyCertComplete]: (state, { payload }) => payload ? spreadThePayloadOnUser(state, payload) : state payload ? spreadThePayloadOnUser(state, payload) : state, [settingsTypes.submitProfileUIComplete]: (state, { payload }) => payload ? { ...state, user: { ...state.user, [state.appUsername]: { ...state.user[state.appUsername], profileUI: { ...payload } } } } : state }, initialState );"} +{"_id":"q-en-freeCodeCamp-7edd1f07966b263c560714052b6fe7c18452a4e8168b40cf75bd2b35b36db920","text":"# --instructions-- Write an `@each` directive that goes through a list: `blue, black, red` and assigns each variable to a `.color-bg` class, where the `color` part changes for each item. Each class should set the `background-color` the respective color. Write an `@each` directive that goes through a list: `blue, black, red` and assigns each variable to a `.color-bg` class, where the `color` part changes for each item to the respective color. Each class should set the `background-color` to the respective color as well. # --hints--"} +{"_id":"q-en-freeCodeCamp-7ee11c540a42eb871ded4c747de9de1f559ebb6396c3adb2728731987c310f7d","text":"h4.negative-10.text-nowrap Community Builder img.profile-image(src='https://s3.amazonaws.com/freecodecamp/branden-byers.jpg' alt=\"Branden Byers picture\") h4.text-nowrap Madison, Wisconsin p.negative-10 \"I'm a massage therapist and Stay-at-home-dad. I learned Hypercard, then Rails, but now I feel at home with JavaScript.\" p.negative-10 \"Cookbook author and stay-at-home-dad. Started coding as a kid, got distracted, but now I'm back in full JavaScript force!\" .col-xs-12.col-sm-4.col-md-3.team-member h3.negative-10.text-nowrap Michael Johnson h4.negative-10.text-nowrap Nonprofit Coordinator"} +{"_id":"q-en-freeCodeCamp-809e96adb74b441195836bce1f6fef081b3944236ad0c436acf2feed46650156","text":"```yml tests: - text: The function countOnline should use a `for in` statement to iterate through the object keys of the object passed to it. testString: assert(code.match(/fors*(s*(var|let)s+[a-zA-Z_$]w*s+ins+[a-zA-Z_$]w*s*)s*{/)); testString: assert(code.match(/fors*(s*(var|let|const)s+[a-zA-Z_$]w*s+ins+[a-zA-Z_$]w*s*)s*{/)); - text: 'The function countOnline should return 1 when the object { Alan: { online: false }, Jeff: { online: true }, Sarah: { online: false } } is passed to it' testString: assert(countOnline(usersObj1) === 1); - text: 'The function countOnline should return 2 when the object { Alan: { online: true }, Jeff: { online: false }, Sarah: { online: true } } is passed to it'"} +{"_id":"q-en-freeCodeCamp-81fa7f1d920a97af7b23e5821736049dd252e625019aa6069d9b4bd9db96fbb3","text":"

${author}

\"${author}

${bio.length > 50 ? bio.slice(0, 49) + '...' : bio}

${bio.length > 50 ? bio.slice(0, 50) + '...' : bio}

${author} author page `;"} +{"_id":"q-en-freeCodeCamp-82ba036863a7a8d1dbe4c1952b81a739c2e3b01c0cc50d04c90786c1115e407c","text":"\"title\": \"Declare String Variables\", \"description\": [ \"In the previous challenge, we used the code var myName = \"your name\". This is what we call a String variable. It is nothing more than a \"string\" of characters. JavaScript strings are always wrapped in quotes.\", \"Now let's create two new string variables: myFirstNameand myLastName and assign them the values of your first and last name, respectively.\" \"Now let's create two new string variables: myFirstName and myLastName and assign them the values of your first and last name, respectively.\" ], \"tests\": [ \"assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), 'message: myFirstName should be a string with at least one character in it.');\","} +{"_id":"q-en-freeCodeCamp-83871e88d50541743c0cafe6ca44f791e342ffca0501a6217680e927b0286584","text":"## Description
To create a CSS Variable, you just need to give it a name with two dashes in front of it and assign it a value like this: To create a CSS variable, you just need to give it a name with two dashes in front of it and assign it a value like this: ```css --penguin-skin: gray;"} +{"_id":"q-en-freeCodeCamp-86c5fa572ad204bc0726fa30641cbbdeaf7c97ec52d49b1bc961473ae3fbf1f8","text":"Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at . Required (non-virtual) DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at . Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. **User Story #1:** My tree map should have a title with a corresponding `id=\"title\"`."} +{"_id":"q-en-freeCodeCamp-86d6feb3a907bb7475af2e69e31548b56f8b29c17b8958d9bb46f3e98bfb0da2","text":"is2018DataVisCert && isApisMicroservicesCert && isFrontEndLibsCert && is2020QaCert && is2020InfosecCert && isInfosecQaCert && isJsAlgoDataStructCert && isRespWebDesignCert;"} +{"_id":"q-en-freeCodeCamp-898583c368b0ec565c4f7dfeb2f924c214505fcb7b34ec31cb85337a67854b6e","text":"text-align: left; } @media screen and (max-width: 767px) { .help-modal .btn-lg { font-size: 16px; } } .help-text-warning { text-align: left; }"} +{"_id":"q-en-freeCodeCamp-8abcb80121cc7764a738948f99cf3e3606ab93c47a2940fc70e7e3bca9fd4779","text":"Puedes ayudarnos a: - [📝 Investigar, escribir y actualizar nuestras guías.](#investiga-escribe-y-actualiza-nuestros-artículos-de-guía) - [📝 Investigar, escribir y actualizar nuestras guías.](#investiga-escribe-y-actualiza-nuestras-guías) - [💻 Crear, actualizar y corregir errores en nuestros desafíos de código.](#crear-actualizar-y-corregir-errores-en-nuestros-desafíos-de-codificación) - [🌐 Traducir artículos de guía y desafíos de código.](#traducir-artículos-de-guía-y-desafíos-de-codificación) - [🛠 Corregir errores en la plataforma de aprendizaje de freeCodeCamp.org.](#ayúdenos-a-corregir-errores-en-la-plataforma-de-aprendizaje-de-freeCodeCamp.org) - [🛠 Corregir errores en la plataforma de aprendizaje de freeCodeCamp.org.](#investiga-escribe-y-actualiza-nuestras-guías) ### Investiga, escribe y actualiza nuestras guías"} +{"_id":"q-en-freeCodeCamp-8c023bd9c174dd60eb45ff4f0eb83a0b6646810e69bfae63e5e364ccc7ea8c28","text":"assert.deepEqual(binarySearch(_testArray, 13), [13]); ``` `binarySearch(testArray, 70)` should return `[13, 19, 22, 49, 70]`. ```js assert.deepEqual(binarySearch(_testArray, 70), [13, 19, 22, 49, 70]); ``` # --seed--"} +{"_id":"q-en-freeCodeCamp-92797f6212552f26ee65b930b85e29a8e4878748e67cdde1e13429b3eb9b9589","text":"assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.media?.mediaText === 'only screen and (max-width: 550px)'); ``` Your new `@media` rule should have a `.hero-title` selector, a `.hero-subtitle, .author, .quote, .list-header` selector, a `.social-icons` selector, and a `.text` selector. These selectors should be in this order. Your new `@media` rule should have a `.hero-title` selector, a `.hero-subtitle, .author, .quote, .list-title` selector, a `.social-icons` selector, and a `.text` selector. These selectors should be in this order. ```js assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.cssRules?.[0]?.selectorText === '.hero-title'); assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.cssRules?.[1]?.selectorText === '.hero-subtitle, .author, .quote, .list-header'); assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.cssRules?.[1]?.selectorText === '.hero-subtitle, .author, .quote, .list-title'); assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.cssRules?.[2]?.selectorText === '.social-icons'); assert(new __helpers.CSSHelp(document).getCSSRules('media')?.[2]?.cssRules?.[3]?.selectorText === '.text'); ```"} +{"_id":"q-en-freeCodeCamp-929f06c2a424937796a92b0df0fb23db2f4e06a176bd6d426c33b6c5203b660a","text":"--- ## Case Studies The Software Engineering Ethics Research Institute of the Department of Computer and Information Sciences at East Tennessee State University published a series of Case Studies to help sensitize practicing software developers and students to the various types of ethical dilemmas they may face. [The International Standard for Professional Software Development and Ethical Responsibility](http://seeri.etsu.edu/TheSECode.htm) forms the basis for much of the analysis in each case. The Markkula Center for Applied Ethics at Santa Clara University published a large collection of case studies to help expose practicing software developers and students to the various types of ethical dilemmas they may face. Cases: * [**Big Brother Spyware**](http://seeri.etsu.edu/SECodeCases/ethicsC/BigBrother.htm) – Raises the issues of the tension between privacy, security, and whistleblowing in a post 11 September environment. * [**Privacy, Technology, and School Shootings**](https://www.scu.edu/ethics/privacy/case-study-on-online-privacy/) - Schools are increasingly monitoring students' online activity. * [**Computerized Patient Records**](http://seeri.etsu.edu/SECodeCases/ethicsC/Computerized%20Patient%20Records.htm) – The case uses patient records to examine the developer’s responsibility for information security. It evaluates a series of alternatives. * [**Disclosing Software Vulnerabilities**](https://www.scu.edu/ethics/focus-areas/business-ethics/resources/the-vulnerability-disclosure-debate/) * [**Death By Wire**](http://seeri.etsu.edu/SECodeCases/ethicsC/DeathByWire.htm) – The case address issues that arise from the shift of control from mechanically based systems to purely electronic/computer systems. It explores a situation where this process has been extended to heavy vehicles. It also looks at what happens when control of safety-critical equipments is turned over to a computer. * [**Shipping Defective Products to Customers**](https://www.scu.edu/ethics/focus-areas/more/engineering-ethics/engineering-ethics-cases/to-ship-or-not-to-ship/) * [**Digital Wallets and Whistle Blowing**](http://seeri.etsu.edu/SECodeCases/ethicsC/DigitalWallets.htm) – This is based on a real case involving security and includes an analysis of the decision related to when and how to whistle blow. * [**Time-Sharing Space**](https://www.scu.edu/ethics/focus-areas/more/engineering-ethics/engineering-ethics-cases/time-sharing-space/) - An intern suspects a fellow intern is being condescending due to her gender. * [**For Girls Only**](http://seeri.etsu.edu/SECodeCases/ethicsC/ForGirlsOnly.htm) – This case looks at a real case of gender bias in the development of software. * [**Copyright Concerns**](https://www.scu.edu/ethics/focus-areas/more/engineering-ethics/engineering-ethics-cases/copyright-concerns/) - An employee develops software with some code that they had previously written while employed at another company. * [**Nano-Technology: Swallow That Chip**](http://seeri.etsu.edu/SECodeCases/ethicsC/NanoTechnology.htm) – This case uses the vehicle of nano-technology to explore ways to address privacy and security issues that face software developers... * [**Unintended Effects**](https://www.scu.edu/ethics/focus-areas/more/engineering-ethics/engineering-ethics-cases/unintended-effects/) - A manager believes his company is providing the wrong form of technology to an in-need community. * [**Patriot Missile Case**](http://seeri.etsu.edu/SECodeCases/ethicsC/PatriotMissile.htm) – This piece examines the importance of configuration management and effective design as they relate to the Patriot Missile Disaster. * [**Therac-25**](http://users.csc.calpoly.edu/~jdalbey/SWE/Papers/THERAC25.html) – This case highlights the danger of software-based controls on life-threatening systems. * [**Insurmountable Differences**](https://www.scu.edu/ethics/focus-areas/more/engineering-ethics/engineering-ethics-cases/insurmountable-differences/) - Responding to racially motivated remarks in the workplace. #### More Information Additional information is available through the [Software Engineering Ethics Research Institute](http://seeri.etsu.edu) * [The Markkula Center's homepage.](https://www.scu.edu/ethics/) "} +{"_id":"q-en-freeCodeCamp-9544ff11e14f7474d81f9b51533b5cac52b1b19bdb5b9415f581b82ae33c0ccf","text":"# --description-- Two or more strings can be concatenated by using the `+` operator. For example: `'Hello' + ' there!'` results in `'Hello there!`. Two or more strings can be concatenated by using the `+` operator. For example: `'Hello' + ' there!'` results in `'Hello there!'`. Call the `print()` function and use the `+` operator to concatenate the `text` variable to the string `'Encrypted text: '`. Pay attention to the spacing."} +{"_id":"q-en-freeCodeCamp-9563c8dbd8612040a98551fad51d705517d2daf889ed661001d440410370536f","text":"bindActionCreators({ submitProfileUI }, dispatch); const propTypes = { isLocked: PropTypes.bool, showAbout: PropTypes.bool, showCerts: PropTypes.bool, showDonation: PropTypes.bool, showHeatMap: PropTypes.bool, showLocation: PropTypes.bool, showName: PropTypes.bool, showPoints: PropTypes.bool, showPortfolio: PropTypes.bool, showTimeLine: PropTypes.bool, submitProfileUI: PropTypes.func.isRequired, user: PropTypes.object user: PropTypes.shape({ profileUI: PropTypes.shape({ isLocked: PropTypes.bool, showAbout: PropTypes.bool, showCerts: PropTypes.bool, showDonation: PropTypes.bool, showHeatMap: PropTypes.bool, showLocation: PropTypes.bool, showName: PropTypes.bool, showPoints: PropTypes.bool, showPortfolio: PropTypes.bool, showTimeLine: PropTypes.bool }), username: PropTypes.String }) }; class PrivacySettings extends Component { constructor(props) { super(props); const originalProfileUI = { ...props.user.profileUI }; this.state = { privacyValues: { ...originalProfileUI }, originalProfileUI: { ...originalProfileUI } }; } componentDidUpdate() { const { profileUI: currentPropsProfileUI } = this.props.user; const { originalProfileUI } = this.state; if (!isEqual(originalProfileUI, currentPropsProfileUI)) { /* eslint-disable-next-line react/no-did-update-set-state */ return this.setState(state => ({ ...state, originalProfileUI: { ...currentPropsProfileUI }, privacyValues: { ...currentPropsProfileUI } })); } return null; } handleSubmit = e => e.preventDefault(); toggleFlag = flag => () => this.setState( state => ({ privacyValues: { ...state.privacyValues, [flag]: !state.privacyValues[flag] } }), () => this.props.submitProfileUI(this.state.privacyValues) ); toggleFlag = flag => () => { const privacyValues = { ...this.props.user.profileUI }; privacyValues[flag] = !privacyValues[flag]; this.props.submitProfileUI(privacyValues); }; render() { const { privacyValues: { isLocked = true, showAbout = false, showCerts = false, showDonation = false, showHeatMap = false, showLocation = false, showName = false, showPoints = false, showPortfolio = false, showTimeLine = false } } = this.state; const { user } = this.props; const { isLocked = true, showAbout = false, showCerts = false, showDonation = false, showHeatMap = false, showLocation = false, showName = false, showPoints = false, showPortfolio = false, showTimeLine = false } = user.profileUI; return (
"} +{"_id":"q-en-freeCodeCamp-9665d078b306f5307b9fbd1d641eae6721a808c28fb47558d7166af42f9ca81a","text":"git cherry-pick ``` 4. Resolve any conflicts, and cleanup, install run tests 4. Resolve any conflicts, cleanup, install dependencies and run tests ```console npm run clean"} +{"_id":"q-en-freeCodeCamp-968e8777a6463600630e5edebbc634d2b38d38ca2de7a59ed9014d872b24cb1d","text":"} ``` However, this should be used with care as using multiple conditional operators without proper indentation may make your code hard to read. For example: It is considered best practice to format multiple conditional operators such that each condition is on a separate line, as shown above. Using multiple conditional operators without proper indentation may make your code hard to read. For example: ```js function findGreaterOrEqual(a, b) {"} +{"_id":"q-en-freeCodeCamp-969d026f30d6161e7f67d89220554bb27a93a85eef958abcb5a14c8b8bb94878","text":"

Is Chuck Norris a Cat Person?

Is Chuck Norris a Cat Person?

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

"} +{"_id":"q-en-freeCodeCamp-9cd9010a484fefd1e349d6f07bb5c367deb845f150c9b49a88d94ff4e3c5de15","text":"# --instructions-- Add your name as the `author` of the project in the package.json file. Add your name as the `author` of the project in the `package.json` file. **Note:** Remember that you’re writing JSON, so all field names must use double-quotes (\") and be separated with a comma (,). # --hints-- package.json should have a valid \"author\" key `package.json` should have a valid \"author\" key ```js (getUserInput) =>"} +{"_id":"q-en-freeCodeCamp-9f0da0991cc001c7be5f12e82895c75d027ff28a80302626cbbb49c209192ef1","text":"\"id\": \"56533eb9ac21ba0edf2244d5\", \"title\": \"Comparison with the Greater Than Or Equal To Operator\", \"description\": [ \"The greater than or equal to operator (>=) compares the values of two numbers. If the number to the left is greater than or equal to the number to the right, it returns true. Otherwise, it returns false.
Like the equality operator, greater than or equal to operator will convert data types while comparing.\",
\"The greater than or equal to operator (>=) compares the values of two numbers. If the number to the left is greater than or equal to the number to the right, it returns true. Otherwise, it returns false.\", \"Like the equality operator, greater than or equal to operator will convert data types while comparing.\", \"Examples\", \"
6 >= 6 // true
7 >= '3' // true
2 >= 3 // false
'7' >= 9 // false
\", \"

Instructions

\","} +{"_id":"q-en-freeCodeCamp-9fb2986656a0771eb9d944ad08422a5e8c9e92de70280c1c8403b315becc8926","text":"{certPath ? ( external={true} to={`certification/${username}/${certPath}`} to={`/certification/${username}/${certPath}`} > {challengeTitle} "} +{"_id":"q-en-freeCodeCamp-9fcaa364e0f3f98b85153039733ce5481e8f5fdc77dff33804d2f133390a9f84","text":"'invalid-protocol': 'URL must start with http or https', 'url-not-image': 'URL must link directly to an image file', 'use-valid-url': 'Please use a valid URL' }, certification: { certifies: 'This certifies that', completed: 'has successfully completed the freeCodeCamp.org', developer: 'Developer Certification, representing approximately', executive: 'Executive Director, freeCodeCamp.org', verify: 'Verify this certification at {{certURL}}', issued: 'Issued' } };"} +{"_id":"q-en-freeCodeCamp-a338fe8f784cef0d3d5af63a029ac4023be46ea51d5d6304d6b2e62219495ad7","text":"# --hints-- Your code should use the `hsl()` function to declare the color `green`. Your code should use the `hsl()` function to declare the color green. ```js assert(code.match(/.greens*?{s*?background-colors*:s*?hsl/gi)); ``` Your code should use the `hsl()` function to declare the color `cyan`. Your code should use the `hsl()` function to declare the color cyan. ```js assert(code.match(/.cyans*?{s*?background-colors*:s*?hsl/gi)); ``` Your code should use the `hsl()` function to declare the color `blue`. Your code should use the `hsl()` function to declare the color blue. ```js assert(code.match(/.blues*?{s*?background-colors*:s*?hsl/gi));"} +{"_id":"q-en-freeCodeCamp-a3b33b9dc662a3409098a61d270341455b66f399cfd5dc1d3398bfdbd6d90698","text":"
external={true} to={`/certification/${username}/${cert.certSlug}`} > View {cert.title}"} +{"_id":"q-en-freeCodeCamp-a3b7b0bcd46c93ab8cb3670c13fdd42fecc926ccb29b56c853c4defb261adaa6","text":"takeEvery(types.updateUserFlag, updateUserFlagSaga), takeLatest(types.submitNewAbout, submitNewAboutSaga), takeLatest(types.submitNewUsername, submitNewUsernameSaga), takeLatest(types.validateUsername, validateUsernameSaga), debounce(2000, types.validateUsername, validateUsernameSaga), takeLatest(types.submitProfileUI, submitProfileUISaga), takeEvery(types.verifyCert, verifyCertificationSaga) ];"} +{"_id":"q-en-freeCodeCamp-a40de38f5ba0dcab83928b4e60f0b864050e39052359fc2d44e125924ba6a792","text":"challengeFile.fileKey === fileKey ? { ...challengeFile, ...updates } : { ...challengeFile } ) ), isBuildEnabled: true }; }, [actionTypes.storedCodeFound]: (state, { payload }) => ({"} +{"_id":"q-en-freeCodeCamp-a52984dc06fce44b55d074a81fa00a9ae1ad42416c2757e13babc468cdd584af","text":"return [ takeLatest(types.executeChallenge, executeCancellableChallengeSaga), takeLatest( [ types.updateFile, types.previewMounted, types.challengeMounted, types.resetChallenge ], [types.updateFile, types.challengeMounted, types.resetChallenge], previewChallengeSaga ), takeLatest(types.previewMounted, previewChallengeSaga, { flushLogs: false }), takeLatest(types.projectPreviewMounted, previewProjectSolutionSaga) ]; }"} +{"_id":"q-en-freeCodeCamp-a618a2192dada80500cd5efdadba79df0541ccec3e988d8fbab7e7d5bea39b96","text":"# --hints-- You should have four `article` elements in your second `section`. ```js const secondSection = document.querySelectorAll('section')[1] const articles = secondSection.querySelectorAll('article') assert(articles.length === 4) ``` You should have four `.dessert` elements. ```js"} +{"_id":"q-en-freeCodeCamp-a701eca9796923318ee9d513fbae526c9ad2543d9db80fb75e1f0ca0807444a1","text":"# --instructions-- Add version \"1.1.0\" of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. **Note:** `@freecodecamp/example` is a faux package used as a learning tool."} +{"_id":"q-en-freeCodeCamp-a7d53ab195efcf5132dcaed837cbc67e8577b76100a1482541e47c66bcca366d","text":"\"Return the provided string with the first letter of each word capitalized.\", \"For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.\" ], \"challengeEntryPoint\": \"titleCase(\"I'm a little tea pot\")\", \"challengeEntryPoint\": \"titleCase(\"I'm a little tea pot\");\", \"challengeSeed\": \"function titleCase(str) {n return str;rn}\", \"tests\": [ \"expect(titleCase(\"I'm a little tea pot\")).to.be.a('String');\","} +{"_id":"q-en-freeCodeCamp-aa099c52e3a5563ea4da1af536d58e37f7de90f904091afc52bfe9a26b3ff164","text":"}); ``` The `draw` method should behave correctly when the number of balls to extract is bigger than the number of balls in the hat. ```js ({ test: () => { pyodide.FS.writeFile(\"/home/pyodide/probability_calculator.py\", code); pyodide.FS.writeFile( \"/home/pyodide/test_module.py\", ` import unittest import probability_calculator from importlib import reload reload(probability_calculator) probability_calculator.random.seed(95) class UnitTests(unittest.TestCase): maxDiff = None def test_hat_draw_2(self): hat = probability_calculator.Hat(yellow=5,red=1,green=3,blue=9,test=1) actual = hat.draw(20) expected = ['yellow', 'yellow', 'yellow', 'yellow', 'yellow', 'red', 'green', 'green', 'green', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'test'] self.assertEqual(actual, expected, 'Expected hat draw to return all items from hat contents.') actual = len(hat.contents) expected = 0 self.assertEqual(actual, expected, 'Expected hat draw to leave no items in contents.') ` ); const testCode = ` from unittest import main import test_module from importlib import reload reload(test_module) t = main(module='test_module', exit=False) t.result.wasSuccessful() `; const out = __pyodide.runPython(testCode); assert(out); }, }); ``` The `experiment` method should return a different probability."} +{"_id":"q-en-freeCodeCamp-aa67d58a2bbfe6502ac684dd08053eea264d5b33efaea97f0a8e86a04de20dc6","text":"
Issued  {t('certification.issued')}  {format(certDate, 'MMMM d, y')}
"} +{"_id":"q-en-freeCodeCamp-b2b844d8cff31a0b068d129dad74631ecc883e11f22818fcd946ab3754ce25c9","text":"Puedes optar por contribuir a cualquier área de tu interés: 1. [Contribuir a esta base de código fuente abierto.](#contribute-to-this-open-source-codebase) 1. [Contribuir a esta base de código fuente abierto.](#contribuye-a-esta-base-de-código-abierto) Ayúdanos a crear o editar [artículos de guía](https://www.freecodecamp.org/guide), [desafíos de codificación](https://www.freecodecamp.org/learn) o a corregir errores en la plataforma de aprendizaje."} +{"_id":"q-en-freeCodeCamp-b325d6f8e345b50f8f7d4560dd59b7f448eddd0f3227f3979f2424bfc61373a6","text":"Your `#video` should have a `src` attribute ```js const el = document.getElementById('video') assert(!!el && !!el.src) let el = document.getElementById('video') const sourceNode = el.children; let sourceElement = null; if (sourceNode.length) { sourceElement = [...video.children].filter(el => el.localName === 'source')[0]; } if (sourceElement) { el = sourceElement; } assert(el.hasAttribute('src')); ``` You should have a `form` element with an `id` of `form`"} +{"_id":"q-en-freeCodeCamp-b48afaa1fa894ce28e8131b6458b5f6c763cc0302eb40393f68e5e9aba7397f1","text":"\"challengeType\": 3, \"nameEs\": \"Crea un juego de Tic Tac Toe\", \"descriptionEs\": [ \"Objetivo: Crea una aplicación con CodePen.io que reproduzca efectivamente mediante ingeniería inversa este app: http://codepen.io/FreeCodeCamp/full/adBpvw.\", \"Objetivo: Construye una aplicación en CodePen.io cuya funcionalidad sea similar a la de esta: http://codepen.io/FreeCodeCamp/full/adBpvw.\", \"Regla #1: No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.\", \"Regla #2: Puedes usar cualquier librería o APIs que necesites.\", \"Regla #3: Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.\", \"Las siguientes son las historias de usuario que debes satisfacer, incluyendo las historias opcionales:\", \"Historia de usuario: Como usuario, puedo iniciar un juego de Tic Tac Toe con la computadora.\", \"Historia de usuario opcional: Como usuario, nunca puedo ganar contra la computadora - en el mejor de los casos puedo empatar.\", \"Historia de usuario opcional: Como usuario, mi juego se reiniciará tan pronto como se termine, de tal forma que pueda jugar de nuevo.\", \"Historia de usuario opcional: Como usuario, puedo elegir si quiero jugar como X o como O.\", \"Recuerda utilizar Read-Search-Ask si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.\", \"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen.

Pulsa aquí y agrega tu link en el texto del tweet\"
\"Regla #2: Satisface las siguientes historias de usuario. Usa cualquier librería o APIs que necesites. Dale tu estilo personal.\", \"Historia de usuario: Puedo jugar un juego de Tic Tac Toe contra el computador.\", \"Historia de usuario: Mi juego se reiniciará tan pronto como termine para poder jugar de nuevo.\", \"Historia de usuario: Puedo elegir si quiero jugar como X o como O.\", \"Recuerda utilizar Leer-Buscar-Preguntar si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un enlace a tu CodePen.\", \"Puedes obtener retroalimentación sobre tu proyecto por parte de otros campistas, compartiéndolo en nuestra Sala de chat para revisión de código. También puedes compartirlo en Twitter y en el campamento de tu ciudad (en Facebook).\" ], \"isRequired\": true },"} +{"_id":"q-en-freeCodeCamp-b8ce72853f5c0c5d57c9ccbe0894a872456b4e1f28e18188f30ab4d70734da75","text":"], \"nameEs\": \"Crea un reloj pomodoro\", \"descriptionEs\": [ \"Objetivo: Crea una aplicación con CodePen.io que reproduzca efectivamente mediante ingeniería inversa este app: http://codepen.io/FreeCodeCamp/full/VemPZX.\", \"Objetivo: Crea una aplicación con CodePen.io cuya funcionalidad sea similar a la de esta: http://codepen.io/FreeCodeCamp/full/VemPZX.\", \"Regla #1: No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.\", \"Regla #2: Puedes usar cualquier librería o APIs que necesites.\", \"Regla #3: Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.\", \"Las siguientes son las historias de usuario que debes satisfacer, incluyendo las historias opcionales:\", \"Historia de usuario: Como usuario, puedo iniciar un pomodoro de 25 minutos, y el cronómetro terminará cuando pasen 25 minutos.\", \"Regla #2: Satisface las siguientes historias de usuario. Usa cualquier librería o APIs que necesites. Dale tu estilo personal.\", \"Historia de usuario: Puedo iniciar un pomodoro de 25 minutos, y el cronómetro terminará cuando pasen 25 minutos.\", \"Historia de usuario: Como usuario, puedo reiniciar el reloj para comenzar mi siguiente pomodoro.\", \"Historia de usuario opcional: Como usuario, puedo personalizar la longitud de cada pomodoro.\", \"Recuerda utilizar Read-Search-Ask si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.\", \"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen.

Pulsa aquí y agrega tu link en el texto del tweet\"
\"Historia de usuario: Como usuario, puedo personalizar la longitud de cada pomodoro.\", \"Recuerda utilizar Leer-Buscar-Preguntar si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un enlace a tu CodePen.\", \"Puedes obtener retroalimentación sobre tu proyecto por parte de otros campistas, compartiéndolo en nuestra Sala de chat para revisión de código. También puedes compartirlo en Twitter y en el campamento de tu ciudad (en Facebook).\" ], \"isRequired\": true, \"challengeType\": 3"} +{"_id":"q-en-freeCodeCamp-baa18dd4ccd67715418643a204872187cfbba08b9032c554cad54f1e8e48ecae","text":"\"<h2 class=\"red-text text-center\">your text</h2>\" ], \"tests\": [ \"assert($(\"h2\").hasClass(\"text-center\"), 'Your h2 element should be centered by applying the class text-center')\" \"assert($(\"h2\").hasClass(\"text-center\"), 'Your h2 element should be centered by applying the class text-center')\", \"assert($(\"h2\").hasClass(\"red-text\"), 'Your h2 element should still have the class red-text')\" ], \"challengeSeed\": [ \"\","} +{"_id":"q-en-freeCodeCamp-bd57c8c0fe44a083a22ca149a0628192ddff400be03ce867a811a1a82a9b6074","text":"

The Garfield Files: Lasagna as Training Fuel?

The Garfield Files: Lasagna as Training Fuel?

The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...

"} +{"_id":"q-en-freeCodeCamp-be80b4c59c6c55b3b2d12ee697b115fecd0669761ac6b35d327e1a8864cece9b","text":"# --description-- Inside the template literal, create a `div` element with the `id` set to the `index` from the `.forEach()` array method. Remember to use template interpolation to do this. Inside the template literal, create a `div` element with the `id` set to the `index` from the `.forEach()` array method. Remember to use string interpolation to do this. Also, add a `class` of `\"user-card\"` to the `div`."} +{"_id":"q-en-freeCodeCamp-c14dbc80c3bd8bc07b629938bbb797d3f59ad0a5fb9b319edfcfa79fbed51bb1","text":"The content of this repository bound by the following licenses: - The computer software is licensed under the [BSD-3-Clause](./LICENSE.md). - The [curricular content](https://www.npmjs.com/package/@freecodecamp/curriculum) in the [`/seed`](/seed) and subdirectories are licensed under the [CC-BY-SA-4.0](https://github.com/freeCodeCamp/curriculum/blob/master/LICENSE.md). "} +{"_id":"q-en-freeCodeCamp-c263dec51cd267a2f234e2ed04d58ddcd4e5b39f4e21ff2a285ec58f51170c0c","text":"\"video\": \"114591799\", \"challengeNumber\": 13, \"steps\": [ \"Now that we've built a foundation in jQuery, let's go back to Dash and do it's last challenge.\", \"Now that we've built a foundation in jQuery, let's go back to Dash and do its last challenge.\", \"If you aren't familiar with Mad Libs, they basically involve inserting random nouns, adjectives and verbs in to stories. The stories that result are often hilarious.\", \"Go to https://dash.generalassemb.ly/projects/mad-libs-1 and complete the fifth project.\" ]"} +{"_id":"q-en-freeCodeCamp-c51091a89b7b43a08602d9f0241fafe51b752d2dfc65413dc9a579876da6787c","text":" --- id: 5a9d7295424fe3d0e10cad14 title: Inherit CSS Variables challengeType: 0 videoUrl: 'https://scrimba.com/c/cyLZZhZ' --- ## Description
When you create a variable, it is available for you to use inside the selector in which you create it. It also is available in any of that selector's descendants. This happens because CSS variables are inherited, just like ordinary properties. To make use of inheritance, CSS variables are often defined in the :root element. :root is a pseudo-class selector that matches the root element of the document, usually the html element. By creating your variables in :root, they will be available globally and can be accessed from any other selector in the style sheet.
## Instructions
Define a variable named --penguin-belly in the :root selector and give it the value of pink. You can then see that the variable is inherited and that all the child elements which use it get pink backgrounds.
## Tests
```yml tests: - text: Declare the --penguin-belly variable in the :root and assign it to pink. testString: assert(code.match(/:roots*?{[sS]*--penguin-bellys*?:s*?pinks*?;[sS]*}/gi), 'Declare the --penguin-belly variable in the :root and assign it to pink.'); ```
## Challenge Seed
```html
```
## Solution
```js var code = \":root {--penguin-belly: pink;}\" ```
"} +{"_id":"q-en-freeCodeCamp-c5b779ac02ff07fe3f5de491e0dc70ea610efbf2d6834a7d6234c646064d46ee","text":"} href={ dropdownFooter ? `https://freecodecamp.org/news/search/?query=${encodeURIComponent( ? `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent( hit.query )}` : hit.url"} +{"_id":"q-en-freeCodeCamp-c8e98db60fc4d3b225f5eda79cb74d18faae540dae82506a6bc16095c1513ca1","text":"\"Vamos a filtrar el gato cuya llave \"id\" tiene un valor de 1.\", \"Aquí está el código para hacer esto:\", \"
json = json.filter(function(val) {
return (val.id !== 1);
});
\" ], \"namePt\": \"Pré-filtro JSON\", \"descriptionPt\": [ \"Se não queremos apresentar cada foto de gato que obtemos da API JSON de fotos de gatos do Free Code Camp, podemos realizar um pré-filtro o JSON antes de iterar através dele.\", \"Vamos filtrar o gato cuja a chave \"id\" tenha o valor 1.\", \"Aqui está o código para fazer isso:\", \"
json = json.filter(function(val) {
return (val.id !== 1);
});
\"
] }, {"} +{"_id":"q-en-freeCodeCamp-c96991cfb1923085bf8ced4582b9a2446b60461973c03af30baff4464bf384ba","text":"--- The conference room Desk --- The elevator Elevator ### --feedback--"} +{"_id":"q-en-freeCodeCamp-ce8aa317a196fb150dea41885d5f51925eb743b51241928fd17f7b481d438706","text":"
Sometimes you won't (or don't need to) know the exact characters in your patterns. Thinking of all words that match, say, a misspelling would take a long time. Luckily, you can save time using the wildcard character: . The wildcard character . will match any one character. The wildcard is also called dot and period. You can use the wildcard character just like any other character in the regex. For example, if you wanted to match \"hug\", \"huh\", \"hut\", and \"hum\", you can use the regex /hu./ to match all four words.
let humStr = \"I'll hum a song\";
let hugStr = \"Bear hug\";
let huRegex = /hu./;
humStr.match(huRegex); // Returns [\"hum\"]
hugStr.match(huRegex); // Returns [\"hug\"]
let humStr = \"I'll hum a song\";
let hugStr = \"Bear hug\";
let huRegex = /hu./;
humStr.test(huRegex); // Returns true
hugStr.test(huRegex); // Returns true
## Instructions"} +{"_id":"q-en-freeCodeCamp-d1ac42c8667e4261b5b8751d5ba0a744badd6f3f72d2a5a77f0d43f8dca2b6e2","text":" --- id: 561add10cb82ac38a17213bd title: Full Stack Certificate challengeType: 7 isHidden: false isPrivate: true --- ## Description
## Instructions
## Tests
```yml tests: - id: 561add10cb82ac38a17513bc title: Responsive Web Design Certificate - id: 561abd10cb81ac38a17513bc title: JavaScript Algorithms and Data Structures Certificate - id: 561acd10cb82ac38a17513bc title: Front End Libraries Certificate - id: 5a553ca864b52e1d8bceea14 title: Data Visualization Certificate - id: 561add10cb82ac38a17523bc title: API's and Microservices Certificate - id: 561add10cb82ac38a17213bc title: Legacy Information Security and Quality Assurance Certificate ```
## Challenge Seed
## Solution
```js // solution required ```
"} +{"_id":"q-en-freeCodeCamp-d3e90eb786b8577857b5b2fdd3021f9f1a7be5983b26dba2e53d4c32a96a87fc","text":"Now navigate to your browser and open http://localhost:3001 If the app loads, congratulations - you're all set. Otherwise, let us know by opening a GitHub issue and with your error. ## Linting Setup You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summary of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line. The reason we enforce this is because one of our dependent NPM modules, [jsonlint](https://github.com/zaach/jsonlint), does not fully support wildcard paths in Windows. ## Found a bug? Do not file an issue until you have followed these steps:"} +{"_id":"q-en-freeCodeCamp-d4eb626d65f8bf89dbd6079e865efbc148b729059a9f99a749ab3554551df78d","text":"## Instructions
Use multiple conditional operators in the checkSign function to check if a number is positive, negative or zero. The function should return \"positive\", \"negative\" or \"zero\". In the checkSign function, use multiple conditional operators - following the recommended format used in findGreaterOrEqual - to check if a number is positive, negative or zero. The function should return \"positive\", \"negative\" or \"zero\".
## Tests"} +{"_id":"q-en-freeCodeCamp-d5d351c7e7f8427078d6058470b1843878ab86a9434fe715198b994c008cd9a8","text":" { \"name\": \"Full Stack Certificate\", \"dashedName\": \"full-stack-certificate\", \"order\": 5, \"time\": \"\", \"template\": \"\", \"required\": [], \"superBlock\": \"certificates\", \"superOrder\": 12, \"challengeOrder\": [ [ \"561add10cb82ac38a17213bd\", \"Full Stack Certificate\" ] ], \"isPrivate\": true, \"fileName\": \"12-certificates/full-stack-certificate.json\" } "} +{"_id":"q-en-freeCodeCamp-d717b430ab2e59e2148923a8961e8ec8c6927710584d879b2fb6753a58a2c8a9","text":"\"assert(typeof(myBike.addUnit) === 'undefined', 'message: myBike.addUnit should remain undefined.');\" ], \"challengeSeed\":[ \"//Let's create an object with a two functions. One attached as a property and one not.\", \"//Let's create an object with two functions. One attached as a property and one not.\", \"var Car = function() {\", \" this.gear = 1;\", \" function addStyle(styleMe){\","} +{"_id":"q-en-freeCodeCamp-d754c243fd4f425ae810ee97f411174bf196a6a8d6671d25cf798f758310a460","text":"If the `bio` text is greater than `50` characters, you should extract the first 50 characters with `slice()` and replace the rest with `...`. Don't forget that indexes are zero-based. ```js assert.match(code, /${s*bio.lengths*>s*50s*?s*bio.slice(s*0,s*49s*)s*+s*(\"|')...2s*:/) assert.match(code, /${s*bio.lengths*>s*50s*?s*bio.slice(s*0,s*50s*)s*+s*(\"|')...2s*:/) ``` If the `bio` text is less than 50 characters, use the `bio` text directly. ```js assert.match(code, /${s*bio.lengths*>s*50s*?s*bio.slice(s*0,s*49s*)s*+s*(\"|')...2s*:s*bios*}

/)
assert.match(code, /${s*bio.lengths*>s*50s*?s*bio.slice(s*0,s*50s*)s*+s*(\"|')...2s*:s*bios*}

/)
```"} +{"_id":"q-en-freeCodeCamp-d84bf714c8f918abb5711c46f348223ba8a01002221304ce0ce9197ad75b7f7d","text":"\"description\": [ \"So we've proven that id declarations override class declarations, regardless of where they are declared in your style element CSS.\", \"There are other ways that you can override CSS. Do you remember inline styles?\", \"Use an in-line style to try to make our h1 element white. Remember, in line styles look like this:\", \"Use an inline style to try to make our h1 element white. Remember, in line styles look like this:\", \"<h1 style=\"color: green\">\", \"Leave the blue-text and pink-text classes on your h1 element.\" ],"} +{"_id":"q-en-freeCodeCamp-d9240f5db966af69695ddbfcb958021dcc1b8999dd1399e17ca62f8e298f6f88","text":"smOffset={ 1 } xs={ 12 } >

className={ `${ns}-description` } dangerouslySetInnerHTML={{ __html: info }} />"} +{"_id":"q-en-freeCodeCamp-da43183d04345f5452bbb5c9c200c0cf553c6995379e9659a9448a7070b8dbc3","text":": '/' + clientLocale; module.exports = { flags: { DEV_SSR: false }, siteMetadata: { title: 'freeCodeCamp', siteUrl: homeLocation"} +{"_id":"q-en-freeCodeCamp-da96f1d359ab5844b1e6cff1eb16e711defca2e7dbc4928e76e5298e9cbfa87f","text":"\"id\": \"bg9997c9c69feddfaeb9bdef\", \"title\": \"Manipulate Arrays With unshift()\", \"description\": [ \"Now that we've learned how to shiftthings from the start of the array, we need to learn how to unshiftstuff back to the start.\", \"Let's take the code we had last time and unshiftthis value to the start: \"Paul\".\" \"Now that we've learned how to shift things from the start of the array, we need to learn how to unshift stuff back to the start.\", \"Let's take the code we had last time and unshift this value to the start: \"Paul\".\" ], \"tests\": [ \"assert((function(d){if(typeof(d[0]) === \"string\" && d[0].toLowerCase() == 'paul' && d[1] == 23 && d[2][0] != undefined && d[2][0] == 'dog' && d[2][1] != undefined && d[2][1] == 3){return true;}else{return false;}})(myArray), 'message: myArray should now have [\"Paul\", 23, [\"dog\", 3]]).');\""} +{"_id":"q-en-freeCodeCamp-db0337b9fa476dc5db365b0a257b9ea2bbc26e84e452630b568d70bf69c85960","text":"testString: assert(confirmEnding(\"He has to give me a new name\", \"name\") === true); - text: confirmEnding(\"Open sesame\", \"same\") should return true. testString: assert(confirmEnding(\"Open sesame\", \"same\") === true); - text: confirmEnding(\"Open sesame\", \"pen\") should return false. testString: assert(confirmEnding(\"Open sesame\", \"pen\") === false); - text: confirmEnding(\"Open sesame\", \"sage\") should return false. testString: assert(confirmEnding(\"Open sesame\", \"sage\") === false); - text: confirmEnding(\"Open sesame\", \"game\") should return false. testString: assert(confirmEnding(\"Open sesame\", \"game\") === false); - text: confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") should return false."} +{"_id":"q-en-freeCodeCamp-db6071eb9b7e0bb9997f7aa1140beae5c0a3bab83d0747f61252c28c0c205c2b","text":"[certType]: true }; if (challenge) { const { id, tests, challengeType } = challenge; if ( !user[certType] && !isCertified(tests, user.completedChallenges) ) { return Observable.just(notCertifiedMessage(certName)); } updateData = { ...updateData, completedChallenges: [ ...user.completedChallenges, { id, completedDate: new Date(), challengeType } ] }; // certificate doesn't exist or // connection error if (!challenge) { reportError(`Error claiming ${certName}`); return Observable.just(failureMessage(certName)); } const { id, tests, challengeType } = challenge; if (!user[certType] && !isCertified(tests, user.completedChallenges)) { return Observable.just(notCertifiedMessage(certName)); } updateData = { ...updateData, completedChallenges: [ ...user.completedChallenges, { id, completedDate: new Date(), challengeType } ] }; if (!user.name) { return Observable.just(noNameMessage);"} +{"_id":"q-en-freeCodeCamp-dcd93f573fe9b6449e6dead840938b11a7be5ab4fee6d9b25b12eccef7f9f2fa","text":"background-position: center; } .testimonial-image { border-radius: 5px; height: 200px; width: 200px; } .testimonial-copy { font-size: 20px; text-align: center; @media (min-width: 991px) and (max-width: 1199px) { height: 120px; } @media (min-width: 1200px) { height: 90px; } } //uncomment this to see the dimensions of all elements outlined in red //* { // border-color: red;"} +{"_id":"q-en-freeCodeCamp-dd12d4c29fbe0b439158ccd7a9e62b6e2227ad34edb60cc08d69243748d0cc4f","text":"is2018DataVisCert, isApisMicroservicesCert, isFrontEndLibsCert, is2020QaCert, is2020InfosecCert, isInfosecQaCert, isJsAlgoDataStructCert, isRespWebDesignCert } = this.props;"} +{"_id":"q-en-freeCodeCamp-dd394a0db5b07c0a1533b5078d68e688612e04076e1cf67135356a8a2ef30bc2","text":"\"Hagamos que nuestro botón \"Get message\" cambie el texto del elemento con clase message.\", \"Antes de poder hacer esto, tenemos que implementar un evento de pulsación dentro de nuestra función $(document).ready(), añadiendo este código:\", \"
$(\"#getMessage\").on(\"click\", function(){

});
\" ], \"namePt\": \"Ativando eventos de clique com jQuery\", \"descriptionPt\": [ \"Nesta sessão, vamos aprender como obter dados de uma API. As APIS - Interface de Programação de Aplicativos - são ferramentas usadas pelos computadores para se comunicarem entre si.\", \"Também aprenderemos como utilizar o HTML com os dados obtidos de uma API usando uma tecnologia chamada Ajax\", \"Em primeiro lugar, vamos revir o que faz a função $(document).ready(). Esta função faz com que todo o codigo que esteja dentro de seu escopo execute somente quando a nossa página tenha sido carregada.\", \"Vamos fazer nosso butão \"Get message\" mudar o texto do elemento com a classe message.\", \"Antes de poder fazer isso, temos que implementar um evento de clique dentro da nossa função $(document).ready(), adicionando este código:\", \"
$(\"#getMessage\").on(\"click\", function(){

});
\"
] }, {"} +{"_id":"q-en-freeCodeCamp-dff63834ac2fabaeec024325a96ddf35db9d3be4f4acc67073686914cbd7d655","text":"

${author}

\"${author}

${bio.length > 50 ? bio.slice(0, 49) + '...' : bio}

${bio.length > 50 ? bio.slice(0, 50) + '...' : bio}

${author} author page
`;"} +{"_id":"q-en-freeCodeCamp-e0933c51e335e9afa83c82093eea9444a78b254d335986ed8096d4f421ba658b","text":"Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at . Required (non-virtual) DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at . Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects. **User Story #1:** My chart should have a title with a corresponding `id=\"title\"`."} +{"_id":"q-en-freeCodeCamp-e2bf12c8051c537107fd1d4c2607610b4209d2ad78872c1fcf294c5a39fdc8f6","text":" import request from 'supertest'; import { build } from '../app'; import { endpoints } from './deprecated-endpoints'; describe('Deprecated endpoints', () => { let fastify: undefined | Awaited>; beforeAll(async () => { fastify = await build(); await fastify.ready(); }, 20000); afterAll(async () => { await fastify?.close(); }); endpoints.forEach(([endpoint, method]) => { test(`${method} ${endpoint} returns 410 status code with \"info\" message`, async () => { const response = await request(fastify?.server)[ method.toLowerCase() as 'get' | 'post' ](endpoint); expect(response.status).toBe(410); expect(response.body).toStrictEqual({ message: { type: 'info', message: 'Please reload the app, this feature is no longer available.' } }); }); }); }); "} +{"_id":"q-en-freeCodeCamp-e425bbdac185dd58ecf5fec4beae2ed8b5f276c9b15bbd62ae4c67cacb57f88b","text":"Pass in only the first element of the `locations` array by adding `[0]` at the end of the variable. For example: `myFunction(arg[0]);`. This is called bracket notation. Values in an array are accessed by index. Indices are numerical values and start at 0 - this is called zero-based indexing. `arg[0]` would be the first element in the `arg` array. This is called bracket notation. Values in an array are accessed by index. Indices are numerical values and start at `0` - this is called zero-based indexing. `arg[0]` would be the first element in the `arg` array. # --hints--"} +{"_id":"q-en-freeCodeCamp-e4ed96661be3312397ffa1f201f117efccb84db7cd3cec1b5164ac2c861ac3d7","text":"```js // doubles input value and returns it const doubler = (item) => item * 2; doubler(4); // returns 8 ``` If an arrow function has a single argument, the parentheses enclosing the argument may be omitted. If an arrow function has a single parameter, the parentheses enclosing the parameter may be omitted. ```js // the same function, without the argument parentheses // the same function, without the parameter parentheses const doubler = item => item * 2; ```"} +{"_id":"q-en-freeCodeCamp-e774f67d80e823ddcc5ae0c890f8041c50647f034c716f7ac16dcb19f862f014","text":"\"challengeType\": 3, \"nameEs\": \"Crea una calculadora JavaScript\", \"descriptionEs\": [ \"Objetivo: Crea una aplicación con CodePen.io que reproduzca efectivamente mediante ingeniería inversa este app: http://codepen.io/FreeCodeCamp/full/zrRzMR.\", \"Objetivo: Crea una aplicación con CodePen.io cuya funcionalidad sea similar a esta: http://codepen.io/FreeCodeCamp/full/zrRzMR.\", \"Regla #1: No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.\", \"Regla #2: Puedes usar cualquier librería o APIs que necesites.\", \"Regla #3: Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.\", \"Las siguientes son las historias de usuario que debes satisfacer, incluyendo las historias opcionales:\", \"Historia de usuario: Como usuario, puedo sumar, restar, multiplicar y dividir dos números.\", \"Regla #2: Satisface las siguientes historias de usuario. Usa cualquier librería o API que necesites. Dale tu estilo personal.\", \"Historia de usuario: Puedo sumar, restar, multiplicar y dividir dos números.\", \"Historia de usuario opcional: Puedo limpiar la pantalla con un botón de borrar.\", \"Historia de usuario opcional: Puedo concatenar continuamente varias operaciones hasta que pulse el botón de igual, y la calculadora me mostrará la respuesta correcta.\", \"Recuerda utilizar Read-Search-Ask si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.\", \"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen.

Pulsa aquí y agrega tu link en el texto del tweet\"
\"Recuerda utilizar Leer-Buscar-Preguntar si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un enlace a tu CodePen. \", \"Puedes obtener retroalimentación sobre tu proyecto por parte de otros campistas, compartiéndolo en nuestra Sala de chat para revisión de código. También puedes compartirlo en Twitter y en el campamento de tu ciudad (en Facebook).\" ], \"isRequired\": true },"} +{"_id":"q-en-freeCodeCamp-e7849fac5e60d8f01bbca263bb4c3582389a523ba890d5bd9c3af100e5c5dfff","text":"const allowedSocialsAndDomains = { githubProfile: 'github.com', linkedin: 'linkedin.com', twitter: 'twitter.com', twitter: ['twitter.com', 'x.com'], website: '' };"} +{"_id":"q-en-freeCodeCamp-e9ee1ec774663eabd51cc58a148fe7b113504a4523732e039ea1ddda6fdf72d2","text":"\"challengeType\": 3, \"nameEs\": \"Construye un juego de Simon\", \"descriptionEs\": [ \"Objetivo: Crea una aplicación con CodePen.io que reproduzca efectivamente mediante ingeniería inversa este app: http://codepen.io/FreeCodeCamp/full/obYBjE.\", \"Objetivo: Construye una aplicación en CodePen.io cuya funcionalidad sea similar a la de esta: http://codepen.io/Em-Ant/full/QbRyqq/.\", \"Regla #1: No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.\", \"Regla #2: Puedes usar cualquier librería o APIs que necesites.\", \"Regla #3: Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.\", \"Las siguientes son las historias de usuario que debes satisfacer, incluyendo las historias opcionales:\", \"Historia de usuario: Como usuario, se me presenta una serie de colores aleatoria.\", \"Historia de usuario: Como usuario, cada vez que presiono una secuencia de colores correctamente, veo la misma serie de colores con un paso adicional.\", \"Historia de usuario: Como usuario, escucho un sonido que corresponde a cada botón cuando una sequencia se me presenta, así como cuando yo presiono un botón.\", \"Historia de usuario: Como usuario, si presiono el botón equivocado, se me notifica sobre mi error, y la serie correcta de colores se muestra de nuevo para recordarme cuál es la secuencia correcta, tras lo cual puedo probar de nuevo.\", \"Historia de usuario: Como usuario, puedo ver cuántos pasos hay en la serie de botones actual.\", \"Historia de usuario opcional: Como usuario, si deseo reiniciar, puedo pulsar un botón para hacerlo, y el juego comenzará desde una secuencia con un solo paso.\", \"Historia de usuario opcional: Como usuario, puedo jugar en modo estricto donde si presiono el botón equivocado, se me notifica de mi error, y el juego vuelve a comenzar con una nueva serie aleatoria de colores.\", \"Historia de usuario opcional: Como usuario, la velocidad del juego se incrementa en el quinto, noveno y decimotercer paso.\", \"Historia de usuario opcional: Como usuario, puedo ganar el juego si completo 20 pasos correctos. Se me notifica sobre mi victoria, tras lo cual el juego se reinicia.\", \"Regla #2: Satisface las siguientes historias de usuario. Usa cualquier librería o APIs que necesites. Dale tu estilo personal.\", \"Historia de usuario: Se me presenta una serie aleatoria de pulsaciones a botones.\", \"Historia de usuario: Cada vez que presiono una secuencia de pulsaciones correctamente, veo que vuelve a ejecutarse la misma serie de pulsaciones con un paso adicional.\", \"Historia de usuario: Escucho un sonido que corresponde a cada botón cuando se ejecuta una secuencia de pulsaciones, así como cuando yo presiono un botón.\", \"Historia de usuario: Si presiono el botón equivocado, se me notifica sobre mi error, y se ejecuta de nuevo la serie correcta de pulsaciones para recordarme cuál es la secuencia correcta, tras lo cual puedo intentar de nuevo.\", \"Historia de usuario: Puedo ver cuántos pasos hay en la serie de pulsaciones actual.\", \"Historia de usuario: Si deseo reiniciar, puedo pulsar un botón para hacerlo, y el juego comenzará desde una secuencia con un solo paso.\", \"Historia de usuario: Puedo jugar en modo estricto donde si presiono el botón equivocado, se me notifica de mi error, y el juego vuelve a comenzar con una nueva serie aleatoria de colores.\", \"Historia de usuario: Puedo ganar el juego si completo 20 pasos correctos. Se me notifica sobre mi victoria, tras lo cual el juego se reinicia.\", \"Pista: Aquí hay algunos mp3s que puedes utilizar para tus botones: https://s3.amazonaws.com/freecodecamp/simonSound1.mp3, https://s3.amazonaws.com/freecodecamp/simonSound2.mp3, https://s3.amazonaws.com/freecodecamp/simonSound3.mp3, https://s3.amazonaws.com/freecodecamp/simonSound4.mp3.\", \"Recuerda utilizar Read-Search-Ask si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.\", \"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen.

Pulsa aquí y agrega tu link en el texto del tweet\"
\"Recuerda utilizar Leer-Buscar-Preguntar si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un enlace a tu CodePen.\", \"Puedes obtener retroalimentación sobre tu proyecto por parte de otros campistas, compartiéndolo en nuestra Sala de chat para revisión de código. También puedes compartirlo en Twitter y en el campamento de tu ciudad (en Facebook).\" ], \"isRequired\": true } ] } No newline at end of file } "} +{"_id":"q-en-freeCodeCamp-eaf6f013d325a432216546c5ab57b6d2ea9466d3e1d0812b5503eefaf7f8b406","text":"Congratulations on behalf of the freeCodeCamp.org team! `; const failureMessage = name => dedent` Something went wrong with the verification of ${name}, please try again. If you continue to receive this error, you can send a message to support@freeCodeCamp.org to get help. `; function ifNoSuperBlock404(req, res, next) { const { superBlock } = req.body; if (superBlock && superBlocks.includes(superBlock)) {"} +{"_id":"q-en-freeCodeCamp-eb7e8f448a663d080ab5d960fca43a21f82685652eccebaebf790db4c91aaf5c","text":" {isSignedIn ? null : ( Sign in to save your progress Sign in to save your progress )}