| {"_id":"q-en-freeCodeCamp-041cba1b7cd3d5f997ec0136904192b242243dd171b490fed76db494c2396a4b","text":"<section> <h2>Cat Form</h2> <form action=\"https://freecatphotoapp.com/submit-cat-photo\"> <del> <fieldset> </del> --fcc-editable-region-- <ins> <fieldset> </ins> <label><input id=\"indoor\" type=\"radio\" name=\"indoor-outdoor\" value=\"indoor\"> Indoor</label> <label><input id=\"outdoor\" type=\"radio\" name=\"indoor-outdoor\" value=\"outdoor\"> Outdoor</label> <del> --fcc-editable-region-- </del> </fieldset> <ins> --fcc-editable-region-- </ins> <input type=\"text\" name=\"catphotourl\" placeholder=\"cat photo URL\" required> <button type=\"submit\">Submit</button> </form>"} | |
| {"_id":"q-en-freeCodeCamp-06dc9d56140e7db7b7cc39cef142b808078e99dfe8d4f1c4cba723a952109ecd","text":"// eslint-disable-next-line max-len it('Worker executor should successfully execute 3 tasks and use 1 worker', async () => { mockWorker(); <del> const testWorker = createWorker('test', { concurrency: 1 }); </del> <ins> const testWorker = createWorker('test', { maxWorkers: 1 }); </ins> const task1 = testWorker.execute('test1'); const task2 = testWorker.execute('test2');"} | |
| {"_id":"q-en-freeCodeCamp-07fd307db27b710d7bfd504dfcccf395943a9cf8d8ae7014ba3c1f112ba3ea87","text":"import { bindActionCreators } from 'redux'; import EditorTabs from './EditorTabs'; import { showUpcomingChanges } from '../../../../../config/env.json'; <ins> import i18next from 'i18next'; </ins> const mapStateToProps = createStructuredSelector({ currentTab: currentTabSelector"} | |
| {"_id":"q-en-freeCodeCamp-08313f954e1cb9b1600d869a27a10a625520fa826a719b61cdc1e4aa12fd2933","text":"\"workshop-blog-page\": { \"title\": \"Build a Cat Blog Page\", \"intro\": [ <del> \"In this workshop, you will learn how to build an HTML only blog page using semantic elements including the main, nav, article and footer elements.\" </del> <ins> \"In this workshop, you will learn how to build an HTML only blog page using semantic elements including the <code>main</code>, <code>nav</code>, <code>article</code> and <code>footer</code> elements.\" </ins> ] }, \"szcd\": { \"title\": \"13\", \"intro\": [] },"} | |
| {"_id":"q-en-freeCodeCamp-0a690555f4574a9f26f49e467599491aa1dcf99310e2acc182b846eb1cb3daa2","text":"<div> <div class=\"spacer\" <del> style=\"padding: 15px 0px; height: 1px;\" </del> <ins> style=\"padding: 15px 0px;\" </ins> /> <div class=\"container\" > <div class=\"spacer\" <del> style=\"padding: 15px 0px; height: 1px;\" </del> <ins> style=\"padding: 15px 0px;\" </ins> /> <div> <div"} | |
| {"_id":"q-en-freeCodeCamp-0a8cedf49c0d056bbc6bac2c842c9226a864ef0d4b92d667a61e227c62e76b73","text":"margin: 0; padding: 0; } .certification-namespace h1 { margin: 12px 0; } .certification-namespace.container { max-width: 1500px; width: 100%;"} | |
| {"_id":"q-en-freeCodeCamp-0b8f3fc43f3286edd2ecdd6cacc386996971a3af6d9e93e2e26c17a42e96b134","text":"section: PropTypes.string }; <del> function ChallengeDescription({ description, instructions, section }) { return ( <div className={`challenge-instructions ${section}`}> <div dangerouslySetInnerHTML={{ __html: description }} /> {instructions && ( <Fragment> <hr /> <div dangerouslySetInnerHTML={{ __html: instructions }} /> </Fragment> )} <hr /> </div> ); </del> <ins> class ChallengeDescription extends Component { componentDidMount() { // Just in case 'current' has not been created, though it should have been. if (this.instructionsRef.current) { Prism.highlightAllUnder(this.instructionsRef.current); } } constructor(props) { super(props); this.instructionsRef = React.createRef(); } render() { const { description, instructions, section } = this.props; return ( <div className={`challenge-instructions ${section}`} ref={this.instructionsRef} > <div dangerouslySetInnerHTML={{ __html: description }} /> {instructions && ( <Fragment> <hr /> <div dangerouslySetInnerHTML={{ __html: instructions }} /> </Fragment> )} <hr /> </div> ); } </ins> } ChallengeDescription.displayName = 'ChallengeDescription';"} | |
| {"_id":"q-en-freeCodeCamp-0baa0e4b137b9770de232b01a51cd1926089ff8dd639c25320dfb6c2634bb48a","text":"# --description-- <del> Add an `else` block to handle the current song's position in the playlist. </del> <ins> Add an `else` block to handle the song's current playback time. This allows you to resume the current song at the point where it was paused. </ins> Within the `else` block, set the `currentTime` property of the `audio` object to the value stored in `userData?.songCurrentTime`."} | |
| {"_id":"q-en-freeCodeCamp-0c80847d2949356f8ccf83e602d8d52a37cada5cf93ebd46f437838662b7c23e","text":"# --description-- <del> Set `monsterHealth` to `monsterHealth` minus the power of the player's current weapon. Remember you have the `currentWeapon` variable and the `power` property. </del> <ins> Set `monsterHealth` to `monsterHealth` minus the power of the player's current weapon. Remember that you can access the power of the player's current weapon using `weapons[currentWeapon].power`. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-0d53c2b93b86e82ad6f8e058af05ae9dd2b24205ecf304b24fbc80c81667979e","text":"const propTypes = { canFocusEditor: PropTypes.bool, children: PropTypes.any, <ins> editorRef: PropTypes.object, </ins> executeChallenge: PropTypes.func, innerRef: PropTypes.any, introPath: PropTypes.string,"} | |
| {"_id":"q-en-freeCodeCamp-0dd8983e161f6a720c148073ab26651d1ed8bfce643c4aa965b7baea20f5a2e5","text":"# --description-- <ins> In programming, it is standard practice to prefix a variable with `is` or `has` to indicate that the variable is a boolean. ```js let isRunning = true; let hasCompleted = false; ``` </ins> Declare an `isError` variable and set it to `false`, but use `let` so you can reassign it later. # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-0dd95176ba2a05fa5fad495cb6b0d0b0b05176982f6192e59fd7a02dbbf9f752","text":"\"difficulty\": 0.13, \"challengeSeed\": \"125671865\", \"description\": [ <del> \"jQuery is a powerful tool for manipulating HTML elements.\", \"It's a lot easier to use than JavaScript itself, so we'll learn it first.\", </del> <ins> \"jQuery is a powerful library built in Javascript for manipulating HTML elements.\", \"It's a lot easier to use than Javascript itself, so we'll learn it first.\", </ins> \"It's also extremely popular with employers, so we're going to learn it well.\", \"Codecademy has an excellent free course that will walk us through the basics of jQuery.\", \"Go to <a href='http://www.codecademy.com/courses/web-beginner-en-bay3D/0/1' target='_blank'>http://www.codecademy.com/courses/web-beginner-en-bay3D/0/1</a> and complete the first section.\""} | |
| {"_id":"q-en-freeCodeCamp-12ca481e404b14f25313dd9e063726060520b3e1899034b9641b592d3ba78613","text":"Three circles of equal radius are placed inside a larger circle such that each pair of circles is tangent to one another and the inner circles do not overlap. There are four uncovered \"gaps\" which are to be filled iteratively with more tangent circles. <del> <img class=\"img-responsive center-block\" alt=\"a diagram of non-overlapping concentric circles\" src=\"https://cdn-media-1.freecodecamp.org/project-euler/199-circles-in-circles.gif\" style=\"background-color: white; padding: 10px;\"> </del> <ins> <img class=\"img-responsive center-block\" alt=\"a diagram of non-overlapping circles\" src=\"https://cdn-media-1.freecodecamp.org/project-euler/199-circles-in-circles.gif\" style=\"background-color: white; padding: 10px;\"> </ins> At each iteration, a maximally sized circle is placed in each gap, which creates more gaps for the next iteration. After 3 iterations (pictured), there are 108 gaps and the fraction of the area which is not covered by circles is 0.06790342, rounded to eight decimal places."} | |
| {"_id":"q-en-freeCodeCamp-13ef632bbb17c57d5202ab50f7e0c36bcb3b0ba16f1d754dc89c0c1f7a3539b4","text":"<li>laser pointers</li> <li>lasagna</li> </ul> <del> <figure> </del> --fcc-editable-region-- <ins> <figure> </ins> <img src=\"https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg\" alt=\"A slice of lasagna on a plate.\"> <del> --fcc-editable-region-- </del> </figure> <ins> --fcc-editable-region-- </ins> </section> </main> </body>"} | |
| {"_id":"q-en-freeCodeCamp-15dd1f542d897d604d9e3085332523d262d790010e74757824dd8512b27cd7e0","text":"if (typeof test.remove !== 'function') { return false; } <ins> test.add(15); test.add(30); </ins> return test.remove(100) == null; })() );"} | |
| {"_id":"q-en-freeCodeCamp-160ed495487e683385e056f1ed1afaa38d9cff3c53aeefaa93710c1533abd705","text":"Chain the `join()` method to your `map()` method and pass in an empty string for the separator. <ins> To chain multiple methods together, you can call the `join()` method on the result of the `map()` method. For example: ```js array.map().join(); ``` </ins> # --hints-- You should add `join(\"\")` to the existing code."} | |
| {"_id":"q-en-freeCodeCamp-1b2319353cf9bcb86372faec97096cf423914bbb4192d8bb257cd08210db9b7f","text":"\"expect(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');\", \"expect(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])).to.be.a('string');\", \"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');\", <del> \"assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 80.00], ['TEN', 10.00], ['FIVE', 5], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');\", </del> <ins> \"assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');\", </ins> \"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'insufficient funds');\", \"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), \"Closed\", 'cash-in-drawer equals change');\" ]"} | |
| {"_id":"q-en-freeCodeCamp-1c27683284abf324350c268a5de4657e82b6d3a858813feadfaa3550cdd67cdf","text":"You should not call the `changeBackgroundColor` function. Instead, assign the function reference to the `onclick` property. ```js <ins> assert.strictEqual(typeof btn.onclick, 'function'); assert.strictEqual(typeof changeBackgroundColor, 'function'); </ins> assert.strictEqual(btn.onclick, changeBackgroundColor); ```"} | |
| {"_id":"q-en-freeCodeCamp-1c8c7c95f785f3ca023e57f710e36441401f4caef5305e60b0c13ac060cbc915","text":"# --description-- <del> Inside `pick`, use `let` to initialize a variable named `numbers` and set it to an empty array. </del> <ins> Inside `pick`, use `const` to initialize a variable named `numbers` and set it to an empty array. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-1d083fbd5b752b463f1a73846bdfe2e66fd87c32eed7263ded2168f1ff7f3f26","text":"} onReady={this.videoIsReady} opts={{ <del> rel: 0, </del> <ins> playerVars: { rel: 0 }, </ins> width: '960px', height: '540px' }}"} | |
| {"_id":"q-en-freeCodeCamp-1e6bb292f5a6562afb5eac23ba882eff93881064a94ced7938f1b72a720f9806","text":"<section id='description'> The <code>sort</code> method sorts the elements of an array according to the callback function. For example: <del> <blockquote>function ascendingOrder(arr) {<br> return arr.sort(function(a, b) {<br> return a - b;<br> });<br>}<br>ascendingOrder([1, 5, 2, 3, 4]);<br>// Returns [1, 2, 3, 4, 5]<br><br>function reverseAlpha(arr) {<br> return arr.sort(function(a, b) {<br> return a < b;<br> });<br>}<br>reverseAlpha(['l', 'h', 'z', 'b', 's']);<br>// Returns ['z', 's', 'l', 'h', 'b']</blockquote> </del> <ins> <blockquote>function ascendingOrder(arr) {<br> return arr.sort(function(a, b) {<br> return a - b;<br> });<br>}<br>ascendingOrder([1, 5, 2, 3, 4]);<br>// Returns [1, 2, 3, 4, 5]<br><br>function reverseAlpha(arr) {<br> return arr.sort(function(a, b) {<br> return a === b ? 0 : a < b ? : 1 : -1;<br> });<br>}<br>reverseAlpha(['l', 'h', 'z', 'b', 's']);<br>// Returns ['z', 's', 'l', 'h', 'b']</blockquote> </ins> Note: It's encouraged to provide a callback function to specify how to sort the array items. JavaScript's default sorting method is by string Unicode point value, which may return unexpected results. </section>"} | |
| {"_id":"q-en-freeCodeCamp-1f15643fcfc7d6474137968bd56c0dc61f1a608a1382910a18b371ceeea7551f","text":"1. When you click on the `#check-btn` element without entering a value into the `#text-input` element, an alert should appear with the text `Please input a value` 1. When the `#text-input` element only contains the letter `A` and the `#check-btn` element is clicked, the `#result` element should contain the text `A is a palindrome` 1. When the `#text-input` element contains the text `eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `eye is a palindrome` <del> 1. When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `eye is a palindrome` </del> <ins> 1. When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `_eye is a palindrome` </ins> 1. When the `#text-input` element contains the text `race car` and the `#check-btn` element is clicked, the `#result` element should contain the text `race car is a palindrome` 1. When the `#text-input` element contains the text `not a palindrome` and the `#check-btn` element is clicked, the `#result` element should contain the text `not a palindrome is not a palindrome` 1. When the `#test-input` element contains the text `A man, a plan, a canal. Panama` and the `#check-btn` element is clicked, the `#result` element should contain the text `A man, a plan, a canal. Panama is a palindrome`"} | |
| {"_id":"q-en-freeCodeCamp-20204c1f057cc2e56e495cef06a9ece31b3da0b727d51c6b0cd87c67e0c2eee5","text":"</div> <div class=\"spacer\" <del> style=\"padding: 15px 0px; height: 1px;\" </del> <ins> style=\"padding: 15px 0px;\" </ins> /> </div> </div>"} | |
| {"_id":"q-en-freeCodeCamp-20400bc3f163301f0e7843a3a52598e02bcf805a4c14ff54ceb77de8acdf56e1","text":"# --description-- <del> Inside your `while` loop, push a random number between 0 and 10 to the end of the `numbers` array. You can create this random number with `Math.floor(Math.random() * 11)`. </del> <ins> Inside your `while` loop, push a random number between `0` and `10` to the end of the `numbers` array. You can create this random number with `Math.floor(Math.random() * 11)`. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-22ef9c21fa3a3e2289de8986c8da7650c0a5b86e0c478fce071e5f24a4eadbf6","text":"`Thermostat` should be a `class` with a defined `constructor` method. ```js <del> assert( typeof Thermostat === 'function' && typeof Thermostat.constructor === 'function' ); </del> <ins> assert.isFunction(Thermostat); assert.isFunction(Thermostat?.constructor); </ins> ``` <del> `class` keyword should be used. </del> <ins> The `class` keyword should be used. </ins> ```js <del> assert(code.match(/class/g)); </del> <ins> assert.match(code, /class/); </ins> ``` `Thermostat` should be able to be instantiated. ```js <del> assert( (() => { const t = new Thermostat(122); return typeof t === 'object'; })() ); </del> <ins> const _t = new Thermostat(122); assert.isObject(_t); </ins> ``` When instantiated with a Fahrenheit value, `Thermostat` should set the correct `temperature`. ```js <del> assert( (() => { const t = new Thermostat(122); return t.temperature === 50; })() ); </del> <ins> const _t = new Thermostat(122); assert.strictEqual(_t?.temperature, 50); </ins> ``` A `getter` should be defined. ```js <del> assert( (() => { const desc = Object.getOwnPropertyDescriptor( Thermostat.prototype, 'temperature' ); return !!desc && typeof desc.get === 'function'; })() ); </del> <ins> const _desc = Object.getOwnPropertyDescriptor(Thermostat.prototype, 'temperature'); assert.isFunction(_desc?.get); </ins> ``` A `setter` should be defined. ```js <del> assert( (() => { const desc = Object.getOwnPropertyDescriptor( Thermostat.prototype, 'temperature' ); return !!desc && typeof desc.set === 'function'; })() ); </del> <ins> const _desc = Object.getOwnPropertyDescriptor(Thermostat.prototype, 'temperature'); assert.isFunction(_desc?.set); </ins> ``` Calling the `setter` with a Celsius value should set the `temperature`. ```js <del> assert( (() => { const t = new Thermostat(32); t.temperature = 26; const u = new Thermostat(32); u.temperature = 50; return t.temperature === 26 && u.temperature === 50; })() ); </del> <ins> const _t = new Thermostat(32); _t.temperature = 26; const _u = new Thermostat(32); _u.temperature = 50; assert.approximately(_t.temperature, 26, 0.1); assert.approximately(_u.temperature, 50, 0.1); </ins> ``` # --seed--"} | |
| {"_id":"q-en-freeCodeCamp-2315b4ef19497b79fd9072d00d9bc6e7302f128045298c338ff3f5afb606a3fb","text":"# --description-- <del> Add a `title` and a `meta` element to the `head`. Give your project a title of `Registration Form`, and give a `charset` attribute with a value of `UTF-8` to your `meta` element. </del> <ins> Add a `title` and `meta` element inside the `head` element. Give your project a title of `Registration Form`, and add the `charset` attribute with a value of `utf-8` to your `meta` element. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-23f29802737e12e1dd80d475aa916ae57225c76684fdf17188e6a1be1e852905","text":"> <Caret /> <h4> <del> Super Block One Certification (300 hours) </del> <ins> Super Block One Certification (300 hours) </ins> </h4> </button> </li>"} | |
| {"_id":"q-en-freeCodeCamp-2682e3d62713d381f94e1f17b03ee44cef853650b42b667fa66df696313b7645","text":"## Instructions <section id='instructions'> Write a <code>remove</code> method that takes an element and removes it from the linked list. <del> Note The <code>length</code> of the list should decrease by one every time an element is removed from the linked list. </del> <ins> <strong>Note:</strong> The <code>length</code> of the list should decrease by one every time an element is removed from the linked list. </ins> </section> ## Tests"} | |
| {"_id":"q-en-freeCodeCamp-27e2990f887bf9234015676789fde56949759d858006da04a1716d9d21e7bafc","text":"```js function whatIsInAName(collection, source) { <del> const arr = []; // Only change code below this line // Only change code above this line return arr; </del> } whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });"} | |
| {"_id":"q-en-freeCodeCamp-2827c84e094fa2ac4d9ba81c7de2f99b3fabea54240f53eb83a076d63fc2d272","text":"# --description-- <del> Add one last conditional statement that checks if the player's `x` position is less than or equal to the sum of the platform's `x` position plus the platform's width minus one-third of the player's width. </del> <ins> Add one last boolean expression that checks if the player's `x` position is less than or equal to the sum of the platform's `x` position plus the platform's width minus one-third of the player's width. </ins> # --hints-- <del> You should have a conditional statement that checks if the player's `x` position is lesser than or equal to the platform's `x` position plus the platform's width minus the player's width divided by `3`. </del> <ins> You should have a boolean expression that checks if the player's `x` position is lesser than or equal to the platform's `x` position plus the platform's width minus the player's width divided by `3`. </ins> ```js assert.match(code, /player.position.xs*<=s*platform.position.xs*+s*platform.widths*-s*player.widths*/s*3,?/)"} | |
| {"_id":"q-en-freeCodeCamp-285a02e58a42bbe95ab5a94f9e55812e49ad2511951e982e946db1df03e34be6","text":"# --seed-- <ins> ## --after-user-code-- ```js let rules=[[\"A -> apple\",\"B -> bag\",\"S -> shop\",\"T -> the\",\"the shop -> my brother\",\"a never used -> .terminating rule\"], [\"A -> apple\",\"B -> bag\",\"S -> .shop\",\"T -> the\",\"the shop -> my brother\",\"a never used -> .terminating rule\"], [\"A -> apple\",\"WWWW -> with\",\"Bgage -> ->.*\",\"B -> bag\",\"->.* -> money\",\"W -> WW\",\"S -> .shop\",\"T -> the\",\"the shop -> my brother\",\"a never used -> .terminating rule\"], [\"_+1 -> _1+\",\"1+1 -> 11+\",\"1! -> !1\",\",! -> !+\",\"_! -> _\",\"1*1 -> x,@y\",\"1x -> xX\",\"X, -> 1,1\",\"X1 -> 1X\",\"_x -> _X\",\",x -> ,X\",\"y1 -> 1y\",\"y_ -> _\",\"1@1 -> x,@y\",\"1@_ -> @_\",\",@_ -> !_\",\"++ -> +\",\"_1 -> 1\",\"1+_ -> 1\",\"_+_ -> \"], [\"A0 -> 1B\",\"0A1 -> C01\",\"1A1 -> C11\",\"0B0 -> A01\",\"1B0 -> A11\",\"B1 -> 1B\",\"0C0 -> B01\",\"1C0 -> B11\",\"0C1 -> H01\",\"1C1 -> H11\"]]; let tests=[\"I bought a B of As from T S.\", \"I bought a B of As from T S.\", \"I bought a B of As W my Bgage from T S.\", \"_1111*11111_\", \"000000A000000\"]; let outputs=[\"I bought a bag of apples from my brother.\", \"I bought a bag of apples from T shop.\", \"I bought a bag of apples with my money from T shop.\", \"11111111111111111111\", \"00011H1111000\"] ``` </ins> ## --seed-contents-- ```js"} | |
| {"_id":"q-en-freeCodeCamp-297b69bb7b3c51fff169cb56edceecfe7be868fdd9c994fd12df4272f9f4ab45","text":"# --description-- <del> **Objective:** Build an app that is functionally similar to this: <a href=\"https://codepen.io/freeCodeCamp/full/JEXgeY\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://codepen.io/freeCodeCamp/full/JEXgeY</a>. </del> <ins> **Objective:** Build an app that is functionally similar to this: <a href=\"https://heat-map.freecodecamp.rocks\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://heat-map.freecodecamp.rocks</a>. </ins> 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."} | |
| {"_id":"q-en-freeCodeCamp-2a72719a2104a4cee5555fbf17dff0a336258cf4564f15fce9c22ad5a9517f19","text":"# --description-- <del> Use the `setAttribute` method on the `playButton` element to set an attribute named `\"aria-label\"`. For the value, use a `ternary` to set `song?.title` to `Play ${song.title}` or `\"Play\"` if there's no `song.title` available. </del> <ins> The `setPlayButtonAccessibleText` function will set the `aria-label` attribute to the current song, or to the first song in the playlist. And if the playlist is empty, it sets the `aria-label` to `\"Play\"`. Use the `setAttribute` method on the `playButton` element to set an attribute named `\"aria-label\"`. For the value, use a ternary to `set song?.title` to `Play ${song.title}` or `\"Play\"` if there's no `song.title` available. </ins> Don't forget you need template interpolation here, so you need to use backticks."} | |
| {"_id":"q-en-freeCodeCamp-2b2c176102b1d699bdc1ea7a3782a7b3c0ed3ec9a33248dfa76aa586fc23d000","text":"import rateLimit from 'express-rate-limit'; // @ts-expect-error - no types import MongoStoreRL from 'rate-limit-mongo'; <ins> import isEmail from 'validator/lib/isEmail'; </ins> import { AUTH0_DOMAIN, MONGOHQ_URL } from '../utils/env'; import { auth0Client } from '../plugins/auth0'; <ins> import { createAccessToken } from '../utils/tokens'; </ins> import { findOrCreateUser } from './helpers/auth-helpers'; <del> const getEmailFromAuth0 = async (req: FastifyRequest) => { </del> <ins> const getEmailFromAuth0 = async ( req: FastifyRequest ): Promise<string | null> => { </ins> const auth0Res = await fetch(`https://${AUTH0_DOMAIN}/userinfo`, { headers: { Authorization: req.headers.authorization ?? '' } }); <del> if (!auth0Res.ok) { req.log.error(auth0Res); throw new Error('Invalid Auth0 Access Token'); } </del> <ins> if (!auth0Res.ok) return null; </ins> <del> const { email } = (await auth0Res.json()) as { email: string }; return email; </del> <ins> // For now, we assume the response is a JSON object. If not, we can't proceed // and the only safe thing to do is to throw. const { email } = (await auth0Res.json()) as { email?: string }; return typeof email === 'string' ? email : null; </ins> }; /**"} | |
| {"_id":"q-en-freeCodeCamp-2befa04a9ebad71829127b7f36778b945e60b88c01711e9236739950d4dbd6af","text":"align-items: center; min-height: 100vh; flex-direction: column; <ins> padding: 50px; </ins> } .certificate-outer-wrapper .donation-section { <del> padding: 20px 0px; </del> <ins> padding-bottom: 100px; </ins> } .certificate-outer-wrapper .donation-section hr {"} | |
| {"_id":"q-en-freeCodeCamp-2eb6ed3a8a1478d59ebf0c832b101c0c9b704f2663d6ff247368dff73bd7ccaa","text":"--fcc-editable-region-- function pick(guess) { <del> let numbers = []; </del> <ins> const numbers = []; </ins> while (numbers.length < 10) { }"} | |
| {"_id":"q-en-freeCodeCamp-2f29df22e4eb50768d2861b9cb18bbca2956ce74fde9757b902232619a8c5035","text":"? 'vs-custom' : editorSystemTheme; <del> const isFailedChallengeTest = (test: Test): test is ChallengeTest => !!test.err && 'text' in test; const firstFailedTest = props.tests.find<ChallengeTest>(test => isFailedChallengeTest(test) ); </del> <ins> const firstFailedTest = props.tests.find(test => !!test.err); </ins> return ( <Suspense fallback={<Loader loaderDelay={600} />}>"} | |
| {"_id":"q-en-freeCodeCamp-2f5b468ed07241648aedda2b26a96bf2ad574a0d7d6609aa69d5c1a9ae0801e5","text":"} const Spacer = ({ size, children }: SpacerProps): JSX.Element => ( <del> <div className='spacer' style={{ padding: `${Padding[size]}px 0`, height: '1px' }} > </del> <ins> <div className='spacer' style={{ padding: `${Padding[size]}px 0` }}> </ins> {children} </div> );"} | |
| {"_id":"q-en-freeCodeCamp-2f76e5db21973ab06f5613c43e50addfdfc840f0dacd000e705b296c33481e1f","text":"type Story = StoryObj<typeof CloseButton>; export const Basic: Story = { <del> args: { className: '', label: '' } </del> <ins> args: {} </ins> }; export default story;"} | |
| {"_id":"q-en-freeCodeCamp-307bef6d68af988395c178aa0b207819a537157d82682fc49d6d83d626160a11","text":"on: workflow_dispatch: schedule: <del> # runs every weekday at 12:15 PM UTC - cron: '15 12 * * 1-5' </del> <ins> # runs Monday and Wednesday at 12:15 PM UTC - cron: '15 12 * * 1,3' </ins> env: GITHUB_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}"} | |
| {"_id":"q-en-freeCodeCamp-30ce38d34f5d6ef81e99e63cafed8d26d9bedb450a228fae661c58c597fc2c1d","text":"if (!codeUri.enabled) { return null; } <del> location.hash = '?solution=' + codeUri.encode(encodeFcc(solution)); </del> <ins> if (history && typeof history.replaceState === 'function') { history.replaceState( history.state, null, '?solution=' + codeUri.encode(encodeFcc(solution)) ); } else { location.hash = '?solution=' + codeUri.encode(encodeFcc(solution)); } </ins> return solution; },"} | |
| {"_id":"q-en-freeCodeCamp-32d6a38a805eab9ae386ddfa001065b415fa319f5eac9f906df266db1735ea2c","text":"padding-bottom: 18px; background: transparent; border: none; <ins> text-align: left; </ins> } button.map-title:hover {"} | |
| {"_id":"q-en-freeCodeCamp-3455f2d86b6c294419a19dfb9bb5ec7538045c513bb00afd04d0cd2b669018d7","text":"const searchButton = document.getElementById('search-button'); let alertMessage; window.alert = (message) => alertMessage = message; // Override alert and store message <del> const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' const numbers = '0123456789'; const charactersLength = letters.length; const numbersLength = numbers.length; const firstLetter = letters.charAt(Math.floor(Math.random() * charactersLength)); const secondLetter = letters.charAt(Math.floor(Math.random() * charactersLength)); const thirdLetter = letters.charAt(Math.floor(Math.random() * charactersLength)); const fourthLetter = letters.charAt(Math.floor(Math.random() * charactersLength)); const randomNumber1 = numbers.charAt(Math.floor(Math.random() * numbersLength)); const randomNumber2 = numbers.charAt(Math.floor(Math.random() * numbersLength)); const badName = firstLetter + secondLetter + thirdLetter + fourthLetter + randomNumber1 + randomNumber2; const randomInvalidPokeId = badName; </del> <ins> const randomInvalidPokeId = crypto.randomUUID().substring(0, 6); </ins> searchInput.value = randomInvalidPokeId; searchInput.dispatchEvent(new Event('change')); searchButton.click(); <del> const res = await fetch('https://pokeapi-proxy.freecodecamp.rocks/api/pokemon/' + randomInvalidPokeId.toString()); // Fetch from proxy to simulate network delay </del> <ins> const res = await fetch('https://pokeapi-proxy.freecodecamp.rocks/api/pokemon/' + randomInvalidPokeId); // Fetch from proxy to simulate network delay </ins> if (!res.ok) { <del> await new Promise(resolve => setTimeout(resolve, 1000)); // Additional delay to allow the alert to trigger </del> <ins> await new Promise(resolve => setTimeout(resolve, 2000)); // Additional delay to allow the alert to trigger </ins> assert.include(['pokémon not found', 'pokemon not found'], alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase()); }"} | |
| {"_id":"q-en-freeCodeCamp-347a7940f854f7324fd4e909a05d998bf8be66469bb0ec1c3832069086cf610b","text":"\"cert-map-estimates\": { \"certs\": \"认证(300 小时)\", \"coding-prep\": \"(数千小时的挑战)\" <ins> }, \"editor-tabs\": { \"info\": \"信息\", \"code\": \"码\", \"tests\": \"测验\", \"preview\": \"预习\" </ins> } }, \"donate\": {"} | |
| {"_id":"q-en-freeCodeCamp-3545893c2df6f9b040b8909d06e6fb895d9134b148827f1219ece97c12772adf","text":"], \"tests\": [ \"assert(typeof timesFive === 'function', 'message: <code>timesFive</code> should be a function');\", <del> \"assert(code.match(/timesFive(s*d+s*)/g), 'message: function <code>timesFive</code> should be called with a number');\", </del> <ins> \"assert(code.match(/timesFive(s*d+s*)/g), 'message: function <code>timesFive</code> should be called with a number');\", </ins> \"assert(timesFive(5) === 25, 'message: <code>timesFive(5)</code> should return <code>25</code>');\", \"assert(timesFive(2) === 10, 'message: <code>timesFive(2)</code> should return <code>10</code>');\", \"assert(timesFive(0) === 0, 'message: <code>timesFive(0)</code> should return <code>0</code>');\""} | |
| {"_id":"q-en-freeCodeCamp-3a87b0cd876460cd27adf81e67874274ab3966f15fa0512a3761bd9437e9c244","text":"} .map-challenge-title { <ins> display: flex; </ins> margin-bottom: 0.25rem; <del> max-width: calc(100% - 80px); </del> <ins> max-width: calc(100% - 105px); } @media (max-width: 640px) { .map-ui .block ul { padding-inline-start: 6px; font-size: 0.9rem; } button.map-title { width: 100%; } .map-ui ul { padding-inline-start: 15px; } .map-ui > ul { padding-inline-start: 0; } .map-challenge-title { max-width: 100%; } .map-title-completed { flex-shrink: 0; padding-left: 15px; } </ins> } .block a { text-decoration: none; } <ins> /* 14px is the width of the expansion arrow */ .superblock { max-width: calc(100% - 14px); } </ins>"} | |
| {"_id":"q-en-freeCodeCamp-3aad62b436343cbcc00b73544849cd53dc61cf070f06c96b83849a907da34c7e","text":"on: workflow_dispatch: schedule: <del> # runs every weekday at 12:30 PM UTC - cron: '30 12 * * 1-5' </del> <ins> # runs Monday and Wednesday at 12:15 PM UTC - cron: '15 12 * * 1,3' </ins> env: GITHUB_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}"} | |
| {"_id":"q-en-freeCodeCamp-3bcdb5aa93cc8dfb9654d4775a542f35d4bef606a83bbcaec69b48a400b1aa59","text":"} = this.props; return ( <Hotkeys <ins> editorRef={this.editorRef} </ins> executeChallenge={executeChallenge} innerRef={this.containerRef} introPath={introPath}"} | |
| {"_id":"q-en-freeCodeCamp-3ca2c401db519a146ac9f21245ea028ff9cea21d434c024585d8dfbfa50c92a3","text":"# --description-- <del> Below that conditional statement, add another conditional statement that checks if the player's `x` position is greater than or equal to the platform's `x` position minus half of the player's width. </del> <ins> Below that boolean expression, add another boolean expression that checks if the player's `x` position is greater than or equal to the platform's `x` position minus half of the player's width. </ins> # --hints-- <del> You should have a conditional statement that checks if the player's `x` position is greater than or equal to the platform's `x` position minus half of the player's width. </del> <ins> You should have a boolean expression that checks if the player's `x` position is greater than or equal to the platform's `x` position minus half of the player's width. </ins> ```js assert.match(code, /consts+collisionDetectionRuless*=s*[s*player.position.ys*+s*player.heights*<=s*platform.position.ys*,s*player.position.ys*+s*player.heights*+s*player.velocity.ys*>=s*platform.position.ys*,s*player.position.xs*>=s*platform.position.xs*-s*player.widths*/s*2,?s*]s*;?/);"} | |
| {"_id":"q-en-freeCodeCamp-3e8314bd106f548181efd51c90017419bdddf10028d9d2187da22ad13fb86e82","text":"{ type: 'info', message: dedent` <del> ${username} has chosen to make their profile private. They will need to make their profile public </del> <ins> ${username} has chosen to make their portfolio private. They will need to make their portfolio public </ins> in order for others to be able to view their certification. ` }"} | |
| {"_id":"q-en-freeCodeCamp-40f8330bf3622f0bd2aec93ed434bb105ec645d2a8a4c59e5a57591c638d6062","text":".tool-panel-group-mobile .btn-block + .btn-block { margin: 0 2px 0 0; <ins> padding-left: 8px; padding-right: 8px; </ins> }"} | |
| {"_id":"q-en-freeCodeCamp-422c827e30abd36531088e0115a23146ee17b5b8ac516b68efed5e95abfc241c","text":"} return bookListCopy; } <del> const newBookList = add(bookList, 'A Brief History of Time'); const newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies'); const newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies'); </del> ```"} | |
| {"_id":"q-en-freeCodeCamp-451b340ae8bc4cc14485952a5b23cbb6bf40cd2254c1d5d143a43718e20f4451","text":"\"Nest one <code>div</code> element with the class <code>well</code> within each of your <code>col-xs-6</code> <code>div</code> elements.\" ], \"tests\": [ <del> \"assert($(\"div\").length > 4, 'Add two <code>div</code> elements inside your <code>div class=\"well\"></code> element both with the class <code>col-xs-6</code>')\", </del> <ins> \"assert($(\"div\").length > 4, 'Add a <code>div</code> element with the class <code>well</code> inside each of your <code>div class=\"col-xs-6\"> elements</code>')\", </ins> \"assert($(\"div.col-xs-6\").children(\"div.well\").length > 1, 'Nest both of your <code>div class=\"col-xs-6\"</code> elements within your <code>div class=\"row\"</code> element.')\", \"assert(editor.match(/</div>/g) && editor.match(/<div/g) && editor.match(/</div>/g).length === editor.match(/<div/g).length, 'Make sure all your <code>div</code> elements have closing tags.')\" ],"} | |
| {"_id":"q-en-freeCodeCamp-48a451fa0147098f193b7ea4c2da6ec075a725f329fddf11a5e0de4bfd761489","text":"# --description-- <del> Turn the words `cat photos` located inside `p` element into a link by replacing the words with the anchor element added previously. The `p` element should show the same text in the browser, but the words `cat photos` should now be a link. There should only be one link showing in the app. </del> <ins> Turn the words `cat photos` located inside `p` element into a link using the same value for the `href` attribute as the link below the `p` element. The `p` element should show the same text in the browser, but the words `cat photos` should now be a link. Make sure to remove the `a` element with the text `cat photos` on the line below the `p` element. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-4949220c061c39885f16b3ddb5c6c8bf630bde52451a5fcacaada343da7361ae","text":"} function pick(guess) { <del> let numbers = []; </del> <ins> const numbers = []; </ins> while (numbers.length < 10) { numbers.push(Math.floor(Math.random() * 11)); }"} | |
| {"_id":"q-en-freeCodeCamp-498391d79773ae235a9284828de3c4ae5f0890d85ade2e27147b27a8d67d9d0a","text":".find('.map-title') .find('h4') .text() <del> ).toBe('Super Block One Certification (300 hours)'); </del> <ins> ).toBe('Super Block One Certification (300xa0hours)'); </ins> expect(enzymeWrapper.find('ul').length).toBe(0); enzymeWrapper.find('.map-title').simulate('click');"} | |
| {"_id":"q-en-freeCodeCamp-498a167568bc9ebc4c1e6352b435d6bf61343d8e90e98be0ae826d61cb155f22","text":"'cert-map-estimates': { certs: 'Certification (300u00A0hours)', 'coding-prep': '(Thousands of hours of challenges)' <ins> }, 'editor-tabs': { info: 'Info', code: 'Code', tests: 'Tests', preview: 'Preview' </ins> } }, donate: {"} | |
| {"_id":"q-en-freeCodeCamp-4a1e493a089a6d75ac6497646215d0985d474083de1dadc7c5134c61cda1a366","text":"Use the addition operator to concatenate a blank space `\" \"` to the beginning and end of your repeated `character` string. <ins> Remember that you can use the `+` operator to concatenate strings like this: ```js \" \" + \"string\" ``` </ins> # --hints-- You should concatenate an empty space to the beginning of your returned value."} | |
| {"_id":"q-en-freeCodeCamp-4a3d4e5c4afc94fc3be8f59102136815d389a69d5c538c048c1f7d6e08a7ceac","text":"# --description-- <del> **Objective:** Build an app that is functionally similar to this: <a href=\"https://codepen.io/freeCodeCamp/full/bgpXyK\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://codepen.io/freeCodeCamp/full/bgpXyK</a>. </del> <ins> **Objective:** Build an app that is functionally similar to this: <a href=\"https://scatterplot-graph.freecodecamp.rocks\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://scatterplot-graph.freecodecamp.rocks</a>. </ins> 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."} | |
| {"_id":"q-en-freeCodeCamp-4b824de3196c9ccb17e4a79d60dbac3c27b273219daf73135cc469a124079951","text":"); renderIsHonestAgreed = () => ( <del> <Panel bsStyle='info' className='agreed btn'> </del> <ins> <Button block={true} bsStyle='primary' className='disabled-agreed' disabled={true} > </ins> <p>You have accepted our Academic Honesty Policy.</p> <del> </Panel> </del> <ins> </Button> </ins> ); render() {"} | |
| {"_id":"q-en-freeCodeCamp-4e56bb6832d49069e15e5909a2fde69cdb8d140db7f58d157fb7660dee521b99","text":"<ins> /** * Adapted from: * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML * Based on https://github.com/chriskempson/tomorrow-theme * @author Rose Pritchard */ .night code[class*='language-'], .night pre[class*='language-'] { color: #ccc; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; font-size: 1em; text-align: left; white-space: pre; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; text-shadow: none; } .night pre[class*='language-'] code[class*='language-'] { color: #d4d4d4; } /* Code blocks */ .night pre[class*='language-'] { padding: 1em; margin: 0.5em 0; overflow: auto; } .night :not(pre) > code[class*='language-'], .night pre[class*='language-'] { background: #242424; } /* Inline code */ .night :not(pre) > code[class*='language-'] { padding: 0.1em; border-radius: 0.3em; white-space: normal; } .night .token.comment, .night .token.block-comment, .night .token.prolog, .night .token.doctype, .night .token.cdata { color: #608b4e; } .night .token.punctuation { color: #ffff00; } .night .token.tag, .night .token.attr-name, .night .token.namespace, .night .token.deleted { color: #e2777a; } .night .token.function-name { color: #d4d4d4; } .night .token.boolean, .night .token.number, .night .token.function { color: #569cd6; } .night .token.property, .night .token.class-name, .night .token.constant, .night .token.symbol { color: #f8c555; } .night .token.selector, .night .token.important, .night .token.atrule, .night .token.keyword, .night .token.builtin { color: #569cd6; } .night .token.string, .night .token.char, .night .token.attr-value, .night .token.regex, .night .token.variable { color: #7ec699; } .night .token.operator, .night .token.entity, .night .token.url { color: #67cdcc; background: none; } .night .token.important, .night .token.bold { font-weight: bold; } .night .token.italic { font-style: italic; } .night .token.entity { cursor: help; } .night .token.inserted { color: green; } </ins>"} | |
| {"_id":"q-en-freeCodeCamp-50ee95a0dfcc65e7d578c7d93e18a3f73821def821763b555be3d60d090fb14d","text":"}; const mapStateToProps = createSelector( <ins> isDonationModalOpenSelector, </ins> userSelector, <del> ({ theme = 'night' }) => ({ theme }) </del> <ins> (open, { theme = 'night' }) => ({ canFocus: !open, theme }) </ins> ); const mapDispatchToProps = dispatch =>"} | |
| {"_id":"q-en-freeCodeCamp-5140150bcf3149e6fa78c3dd7e715bb659de5ae81f50e569e449d9c7fa85c978","text":".find('.map-title') .find('h4') .text() <del> ).toBe('Super Block One Certification (300 hours)'); </del> <ins> ).toBe('Super Block One Certification (300xa0hours)'); </ins> expect(enzymeWrapper.find('ul').length).toBe(1); });"} | |
| {"_id":"q-en-freeCodeCamp-516e2789e59d8bcaecb63eaa4fd205662b33807a11ed0a1cd4e22fc2d1999e0c","text":"editorDidMount = (editor, monaco) => { this._editor = editor; <del> this._editor.focus(); </del> <ins> if (this.props.canFocus) this._editor.focus(); </ins> this._editor.addAction({ id: 'execute-challenge', label: 'Run tests',"} | |
| {"_id":"q-en-freeCodeCamp-53f9e32b634ce0abdf49373b032ea05585439dff628a16bc7dae1e5e2b5a51a5","text":"Your `<title>` element should be nested in your `<head>` element. ```js <del> assert(code.match(/<head>s*<title>.*</title>s*</head>/i)); </del> <ins> assert(code.match(/<head>s*<title>.*</title>s*</head>/si)); </ins> ``` Your `<title>` element should have the text `Camper Cafe Menu`. You may need to check your spelling. ```js <del> assert(code.match(/<title>camperscafesmenu</title>/i)); </del> <ins> assert.match(document.querySelector('title')?.innerText, /camper cafe menu/i); </ins> ``` # --seed--"} | |
| {"_id":"q-en-freeCodeCamp-540867b40d8e563c0bc53f2ed7b8cbc822e97a34b4d344ea88cf1acc6935ec66","text":"When a method returns a value, you can think of it as giving the value back to you, making it available for use in other parts of your code. <del> Declare a `popped` variable, and assign it the result of `rows.pop()`. Then, log your `popped` variable. </del> <ins> Create a new variable called `popped` and assign it the result of `rows.pop()`. Then, log `popped` to the console. </ins> # --hints-- <del> You should declare a `popped` variable. </del> <ins> You should declare a variable called `popped`. </ins> ```js assert.match(code, /popped/); ``` <del> You should use `let` to declare your `popped` variable. </del> <ins> You should use `let` to declare your variable called `popped`. </ins> ```js assert.match(code, /lets+popped/);"} | |
| {"_id":"q-en-freeCodeCamp-544a74a169114e16ccd7737fe6a891713801008aad1eb0e4ddcf76158a960eca","text":"```js const splitter = code.split(\"if (this.position.x < this.width) {\") <ins> assert.match(splitter[1], /this.heights*=s*proportionalSize(s*d+s*)s*;?/); ``` You should assign `proportionalSize(40)` to the `height` property. ```js const splitter = code.split(\"if (this.position.x < this.width) {\") </ins> assert.match(splitter[1], /this.heights*=s*proportionalSize(s*40s*)s*;?/); ```"} | |
| {"_id":"q-en-freeCodeCamp-54844e96bb6814ed64e45b87b40cc46d880e5aa9f334537683ff8d751eef456a","text":"if (element.type === FourOhFourPage) { return <DefaultLayout pathname={pathname}>{element}</DefaultLayout>; } <del> if (/^/certification(/.*)*/.test(pathname)) { </del> <ins> if (//certification//.test(pathname)) { </ins> return ( <CertificationLayout pathname={pathname}>{element}</CertificationLayout> ); } <del> if (/^/guide(/.*)*/.test(pathname)) { </del> <ins> if (//guide//.test(pathname)) { </ins> console.log('Hitting guide for some reason. Need a redirect.'); } const splitPath = pathname.split('/'); <del> const splitPathThree = splitPath.length > 2 ? splitPath[3] : ''; </del> <ins> const isSuperBlock = (splitPath.length === 3 && splitPath[1]) || (splitPath.length === 4 && splitPath[2]); </ins> <del> const isNotSuperBlockIntro = splitPath.length > 3 && splitPathThree.length > 1; if (/^/learn(/.*)*/.test(pathname) && isNotSuperBlockIntro) { </del> <ins> if (//learn//.test(pathname) && !isSuperBlock) { </ins> return ( <DefaultLayout pathname={pathname} showFooter={false}> {element}"} | |
| {"_id":"q-en-freeCodeCamp-553ab982190dd44fb60b2bdcf14def37e543ece44d5de514361a064884f63613","text":"export function transformEditorLink(url) { return url .replace( <del> /(?<=//)(?<projectname>[^.]+).(?<username>[^.]+).repl.co/?/, 'replit.com/@$<username>/$<projectname>' </del> <ins> /(//)(?<projectname>[^.]+).(?<username>[^.]+).repl.co/?/, '//replit.com/@$<username>/$<projectname>' </ins> ) .replace( <del> /(?<=//)(?<projectname>[^.]+).glitch.me/?/, 'glitch.com/edit/#!/$<projectname>' </del> <ins> /(//)(?<projectname>[^.]+).glitch.me/?/, '//glitch.com/edit/#!/$<projectname>' </ins> ); }"} | |
| {"_id":"q-en-freeCodeCamp-57b0017ddf357e664216a04023809217849ee8b405580cb146727d22f8dae46d","text":"assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'eye is a palindrome'); ``` <del> When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `eye is a palindrome`. </del> <ins> When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `_eye is a palindrome`. </ins> ```js const inputEl = document.getElementById('text-input');"} | |
| {"_id":"q-en-freeCodeCamp-5a9da76d4d3e91f9636b2d3a1ae6014421924b267867ad432f5fc0d127bf771d","text":"# --description-- <del> Use `const` and arrow syntax to define a function called `setPlayButtonAccessibleText`. </del> <ins> To make the application more accessible, it is important that the play button describes the current song or the first song in the playlist. </ins> <del> This function will set the `aria-label` attribute to the current song, or to the first song in the playlist. And if the playlist is empty, it sets the `aria-label` to `\"Play\"`. </del> <ins> Start by creating an empty arrow function called `setPlayButtonAccessibleText`. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-5b0a204278c61e2359127b90f69757fe3751f8ba8543549f5a247ac29e448d18","text":"// all auth routes. fastify.addHook('onRequest', fastify.redirectIfSignedIn); <del> fastify.get('/mobile-login', async req => { </del> <ins> fastify.get('/mobile-login', async (req, reply) => { </ins> const email = await getEmailFromAuth0(req); <del> await findOrCreateUser(fastify, email); </del> <ins> if (!email) { return reply.status(401).send({ message: 'We could not log you in, please try again in a moment.', type: 'danger' }); } if (!isEmail(email)) { return reply.status(400).send({ message: 'The email is incorrectly formatted', type: 'danger' }); } const { id } = await findOrCreateUser(fastify, email); reply.setAccessTokenCookie(createAccessToken(id)); </ins> }); done();"} | |
| {"_id":"q-en-freeCodeCamp-5ca4607b86ac9d67d795cf5016ab401437e8efb7809e1b03550a35496028649a","text":".table > tfoot > tr > td { border: none; } <ins> .modal { overflow-y: auto; } </ins>"} | |
| {"_id":"q-en-freeCodeCamp-5ca69c2f35a2742cf0a2d83f8cb8df0d99b7d99f67a6b5f7fb9f75688d5e5cc0","text":"// eslint-disable-next-line max-len it('Worker executor should successfully execute 3 tasks in parallel and use 3 workers', async () => { mockWorker(); <del> const testWorker = createWorker('test', { concurrency: 3 }); </del> <ins> const testWorker = createWorker('test', { maxWorkers: 3 }); </ins> const task1 = testWorker.execute('test1'); const task2 = testWorker.execute('test2');"} | |
| {"_id":"q-en-freeCodeCamp-5cdfcc127684a1b331d967ae6aa386f5fb0022f8f0090da1efd330acbe7e0c57","text":"Here you'll build a cash register app that will return change to the customer based on the price of the item, the amount of cash provided by the customer, and the amount of cash in the cash drawer. You'll also need to show different messages to the user in different scenarios, such as when the customer provides too little cash or when the cash drawer doesn't have enough to issue the correct change. <del> There are a few variables you'll need to use in your code: </del> <ins> In the `script.js` file, you have been provided with the `price` and `cid` variables. The `price` variable is the price of the item, and the `cid` variable is the cash-in-drawer, which is a 2D array listing the available currency in the cash drawer. </ins> <del> - `price`: the price of the item as a floating point number. - `cash`: the amount of cash provided by the customer for the item, which is provided via an `input` element on the page. - `cid`: cash-in-drawer, a 2D array listing available currency in the cash drawer. </del> <ins> The other variable you will need add is the `cash` variable, which is the amount of cash provided by the customer for the item, which is provided via an `input` element on the page. </ins> If you'd like to test your application with different values for `price` and `cid`, make sure to declare them with the `let` keyword so they can be reassigned by our tests."} | |
| {"_id":"q-en-freeCodeCamp-5d2f1cac474bf2142efa1c407b0584cf764bb893d13b375142cfdd205557cd49","text":"<Fragment> <FullWidthRow> <h2 className='text-center'> <del> {username} has not made their profile public. </del> <ins> {username} has not made their portfolio public. </ins> </h2> </FullWidthRow> <FullWidthRow> <p className='alert alert-info'> {username} needs to change their privacy setting in order for you to <del> view their profile. </del> <ins> view their portfolio. </ins> </p> </FullWidthRow> <Spacer />"} | |
| {"_id":"q-en-freeCodeCamp-5e9184a85489f8e293b9ccc795161b1e0a8d3ec64795244cf38d4ebde353d607","text":"#challenge-page-tabs .nav-tabs > li > a { padding: 5px 10px; <ins> text-decoration: none; font-size: 0.8em; </ins> } #challenge-page-tabs .tab-content {"} | |
| {"_id":"q-en-freeCodeCamp-5f3fa8d85f11898d591bef2d7e015e69eb1a4ee7328e5b5e0334d6a6afb5622a","text":"var test = new LinkedList(); test.add('cat'); test.add('dog'); <del> return test.head().next.element === 'dog'; </del> <ins> test.add('fish'); return test.head().next.element === 'dog' && test.head().next.next.element === 'fish'; </ins> })() ); ```"} | |
| {"_id":"q-en-freeCodeCamp-61524963d9213b1ac39671c6491473321f23ef9c438aceae9eebc88ff2c4e764","text":"} .form-control { <del> color: var(--theme-color); </del> <ins> color: var(--primary-color); </ins> outline: none; border-color: var(--quaternary-background); <ins> background-color: var(--primary-background); </ins> -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important;"} | |
| {"_id":"q-en-freeCodeCamp-61aa1d6fe0327e8f49bcc8c2379eb2f0e837050569e31c3531096d3fd20399da","text":"openHelpModal={props.openHelpModal} openResetModal={props.openResetModal} tryToExecuteChallenge={tryToExecuteChallenge} <del> hint={firstFailedTest?.text} </del> <ins> hint={firstFailedTest?.message} </ins> testsLength={props.tests.length} attempts={attemptsRef.current} challengeIsCompleted={challengeIsComplete()}"} | |
| {"_id":"q-en-freeCodeCamp-629a7dd0100564ea347696aad9c0c05b6cf454547499fe1363396fffefdc4882","text":"<ins> // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`<Honesty /> <Honesty /> snapshot when isHonest is false: Honesty 1`] = ` <section className=\"honesty-policy\" > <SectionHeader> Academic Honesty Policy </SectionHeader> <FullWidthRow> <Uncontrolled(Panel) className=\"honesty-panel\" > <HonestyPolicy /> </Uncontrolled(Panel)> <br /> <Button active={false} block={true} bsClass=\"btn\" bsStyle=\"primary\" disabled={false} onClick={[Function]} > Agree </Button> </FullWidthRow> </section> `; exports[`<Honesty /> <Honesty /> snapshot when isHonest is true: HonestyAccepted 1`] = ` <section className=\"honesty-policy\" > <SectionHeader> Academic Honesty Policy </SectionHeader> <FullWidthRow> <Uncontrolled(Panel) className=\"honesty-panel\" > <HonestyPolicy /> </Uncontrolled(Panel)> <br /> <Button active={false} block={true} bsClass=\"btn\" bsStyle=\"primary\" className=\"disabled-agreed\" disabled={true} > <p> You have accepted our Academic Honesty Policy. </p> </Button> </FullWidthRow> </section> `; </ins>"} | |
| {"_id":"q-en-freeCodeCamp-633d1246569e890793bdc2a0e8913c9d13d07982c8e37018ff838a4e70e85475","text":"This will open the user management tools, you will be able to see the list of all the users. <del> Search for the user that will become contributor. Use the three dots menu on the user row to open a menu and select \"Add to team\". The proofreader teams have a standard name of `Proof Readers (<language>)`, you can search the team using the language name. Once you have selected the team, use the \"ADD\" button at the bottom of the page to finalize the thing. </del> <ins> Search for the user that will become proofreader. Use the three dots menu on the user row to open a menu and select \"Add to team\". The proofreader teams have a standard name of `Proof Readers (<language>)`, you can search the team using the language name. Once you have selected the team, use the \"ADD\" button at the bottom of the page to finalize the thing. </ins> The user is now a proofreader."} | |
| {"_id":"q-en-freeCodeCamp-6751a6f292c6c56bccabd46abe6d9336e65bfdb6cd6db6508d1fceadff9123fd","text":"id='challenge-page-tabs' onSelect={moveToTab} > <del> <TabPane eventKey={1} title='Instructions'> </del> <ins> <TabPane eventKey={1} title='Info'> </ins> {instructions} </TabPane> <TabPane eventKey={2} title='Code' {...editorTabPaneProps}>"} | |
| {"_id":"q-en-freeCodeCamp-68bedfe13eaf777533544616749de5a42a8ce86fa84f3d68ffcdb5a7e601a531","text":"Which starting number, under the given `limit`, produces the longest chain? <del> **Note:** Once the chain starts the terms are allowed to go above one million. </del> <ins> **Note:** Once the chain starts the terms are allowed to go above `limit`. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-6b9b29dbb37f7cdad106a8553d815de68e5cc9d9f72eba798e39d72efba8a7cf","text":"height: 100%; overflow: hidden; } <del> #challenge-page-tabs a { text-decoration: none; } #challenge-page-tabs a:hover { color: var(--secondary-background); </del> <ins> #challenge-page-tabs .nav-tabs > li.active > a { color: var(--quaternary-color); background-color: var(--quaternary-background); </ins> }"} | |
| {"_id":"q-en-freeCodeCamp-6c6d546c6eb1b68a0a300eddd5a4c59ea7c973405fa140fef390226cb52a370f","text":".map-title-completed { margin-left: auto; <del> width: 100px; </del> <ins> min-width: 100px; </ins> padding-left: 20px; }"} | |
| {"_id":"q-en-freeCodeCamp-6ce19a389989e8872e917d8a93ce246cd4be2e643d7bf487d2ecddbd00543017","text":"id='challenge-page-tabs' onSelect={moveToTab} > <del> <TabPane eventKey={1} title='Info'> </del> <ins> <TabPane eventKey={1} title={i18next.t('learn.editor-tabs.info')}> </ins> {instructions} </TabPane> <del> <TabPane eventKey={2} title='Code' {...editorTabPaneProps}> </del> <ins> <TabPane eventKey={2} title={i18next.t('learn.editor-tabs.code')} {...editorTabPaneProps} > </ins> {showUpcomingChanges && <EditorTabs />} {editor} </TabPane> <del> <TabPane eventKey={3} title='Tests' {...editorTabPaneProps}> </del> <ins> <TabPane eventKey={3} title={i18next.t('learn.editor-tabs.tests')} {...editorTabPaneProps} > </ins> {testOutput} </TabPane> {hasPreview && ( <del> <TabPane eventKey={4} title='Preview'> </del> <ins> <TabPane eventKey={4} title={i18next.t('learn.editor-tabs.preview')} > </ins> {preview} </TabPane> )}"} | |
| {"_id":"q-en-freeCodeCamp-6d3a600723d1929e68ad748cbf975327ffbdaed7be0d7e9c27b694c516fd88aa","text":"# --hints-- <del> There should be an `img` element right above the second `section` element's closing tag. </del> <ins> There should be an `img` element right after the closing `</ul>` tag. </ins> ```js assert($('section')[1].lastElementChild.nodeName === 'IMG');"} | |
| {"_id":"q-en-freeCodeCamp-6e83255159092eecf61dde89628c24c347e5a6381a530fb8abe220c777572048","text":".scene-wrapper { overflow: hidden; position: relative; <ins> color: var(--gray-00); </ins> } .scene-start-screen {"} | |
| {"_id":"q-en-freeCodeCamp-6ede35176b133bed5548bc2c54e5ba82c0fe01faad083ac5ab39f33c6f7eda33","text":"id: 587d778b367417b2b2512aa8 title: Add an Accessible Date Picker challengeType: 0 <del> videoUrl: 'https://scrimba.com/c/cD9DJHr' </del> <ins> videoUrl: 'https://scrimba.com/c/cR3bRbCV' </ins> --- ## Description"} | |
| {"_id":"q-en-freeCodeCamp-6f8c9d014df3f93aa04d1d8c6f156a0cce36944ed5ca31b7f9d87998ab6fb899","text":"} } <ins> focusOnEditor() { this._editor.focus(); } </ins> onChange = editorValue => { const { updateFile, fileKey } = this.props; updateFile({ key: fileKey, editorValue });"} | |
| {"_id":"q-en-freeCodeCamp-704828b50424d3decb27a0e7f79576f4af5d0563e0c86bcf6db0c8c3de5d2261","text":"return ( <Fragment> <p key={1}> <del> Before we issue our verified certification to a camper, he or she must accept our Academic Honesty Pledge, which reads: </del> <ins> Before you can claim a verified certification, you must accept our Academic Honesty Pledge, which reads: </ins> </p> <p key={2}> \"I understand that plagiarism means copying someone else’s work and"} | |
| {"_id":"q-en-freeCodeCamp-721dada2aca92efc07f0b73f8912fddeceee56cdce285fdf7cc4a732c1882c62","text":"}, timeout); worker.onmessage = e => { <del> if (e.data && e.data.type) { </del> <ins> clearTimeout(timeoutId); // data.type is undefined when the message has been processed // successfully and defined when something else has happened (e.g. // an error occurred) if (e.data?.type) { </ins> this.emit(e.data.type, e.data.data); <del> return; </del> <ins> } else { this.emit('done', e.data); </ins> } <del> clearTimeout(timeoutId); this.emit('done', e.data); </del> }; worker.onerror = e => {"} | |
| {"_id":"q-en-freeCodeCamp-7247e86453a7e100b5758504925d65575f9196183c23c89bf68c52425f02f100","text":"assert.match(calculateCalories.toString(), /document.querySelectorAll(s*('|\")#breakfast input[s*type=numbers*]s*1s*)/); ``` <del> You should assign the result of your `odocument.querySelectorAll()` call to `breakfastNumberInputs`. </del> <ins> You should assign the result of your `document.querySelectorAll()` call to `breakfastNumberInputs`. </ins> ```js assert.match(calculateCalories.toString(), /breakfastNumberInputss*=s*document.querySelectorAll(s*('|\")#breakfast input[s*type=numbers*]s*1s*)/);"} | |
| {"_id":"q-en-freeCodeCamp-72c7af0aab29a7c5784d4c077e5c7cf824e3f534bbb2bb380658f7a53cdc8b1c","text":"class WorkerExecutor { constructor( workerName, <del> { location = '/js/', concurrency = 2, terminateWorker = false } = {} </del> <ins> { location = '/js/', maxWorkers = 2, terminateWorker = false } = {} </ins> ) { <del> this._workerName = workerName; this._workers = []; this._queue = []; this._running = 0; this._concurrency = concurrency; </del> <ins> this._workerPool = []; this._taskQueue = []; this._workersInUse = 0; this._maxWorkers = maxWorkers; </ins> this._terminateWorker = terminateWorker; <del> this._location = location; </del> <ins> this._scriptURL = `${location}${workerName}.js`; </ins> this._getWorker = this._getWorker.bind(this); } async _getWorker() { <del> let worker; if (this._workers.length) { worker = this._workers.shift(); } else { worker = await new Promise((resolve, reject) => { const worker = new Worker(`${this._location}${this._workerName}.js`); worker.onmessage = e => { if (e.data && e.data.type && e.data.type === 'contentLoaded') { resolve(worker); } }; worker.onerror = err => reject(err); }); } return worker; </del> <ins> return this._workerPool.length ? this._workerPool.shift() : this._createWorker(); </ins> } <del> _pushTask(task) { this._queue.push(task); this._next(); </del> <ins> _createWorker() { return new Promise((resolve, reject) => { const newWorker = new Worker(this._scriptURL); newWorker.onmessage = e => { if (e.data?.type === 'contentLoaded') { resolve(newWorker); } }; newWorker.onerror = err => reject(err); }); </ins> } _handleTaskEnd(task) { return () => { <del> this._running--; if (task._worker) { const worker = task._worker; </del> <ins> this._workersInUse--; const worker = task._worker; if (worker) { </ins> if (this._terminateWorker) { worker.terminate(); } else { worker.onmessage = null; worker.onerror = null; <del> this._workers.push(worker); </del> <ins> this._workerPool.push(worker); </ins> } } <del> this._next(); </del> <ins> this._processQueue(); </ins> }; } <del> _next() { while (this._running < this._concurrency && this._queue.length) { const task = this._queue.shift(); </del> <ins> _processQueue() { while (this._workersInUse < this._maxWorkers && this._taskQueue.length) { const task = this._taskQueue.shift(); </ins> const handleTaskEnd = this._handleTaskEnd(task); task._execute(this._getWorker).done.then(handleTaskEnd, handleTaskEnd); <del> this._running++; </del> <ins> this._workersInUse++; </ins> } }"} | |
| {"_id":"q-en-freeCodeCamp-7674d29d821eff830e67145efc202723b4e922df854cc62f7af427aecf33b761","text":"The `rem` unit stands for `root em`, and is relative to the font size of the `html` element. <del> Create an `.small-text` selector and set the `font-size` to `0.85rem`, which would calculate to be roughly `13.6px` (remember that you set your `html` to have a `font-size` of `16px`). </del> <ins> Create a `.small-text` selector and set the `font-size` to `0.85rem`, which would calculate to roughly `13.6px` (remember that you set your `html` to have a `font-size` of `16px`). </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-77e93586eda19a711b3f60d1b26499c484c767dea680546261ae5ed7dbd905e1","text":"# --description-- <del> Add another conditional statement that checks if the sum of the player's `y` position, height, and `y` velocity is greater than or equal to the platform's `y` position. </del> <ins> Add another boolean expression that checks if the sum of the player's `y` position, height, and `y` velocity is greater than or equal to the platform's `y` position. </ins> # --hints-- <del> You should have a conditional statement that checks if the sum of the player's `y` position, height, and `y` velocity is greater than or equal to the platform's `y` position. </del> <ins> You should have a boolean expression that checks if the sum of the player's `y` position, height, and `y` velocity is greater than or equal to the platform's `y` position. </ins> ```js"} | |
| {"_id":"q-en-freeCodeCamp-792fdc96e5461e88faa66584efb2e12ef40dd20282532e6e4ef086625e565bd7","text":"\"Try creating one of each.\" ], \"tests\":[ <del> \"assert(editor.getValue().match(/(//)...../g), 'Create a <code>//</code> style comment that contains at least five letters');\", \"assert(editor.getValue().match(/(/*)...../g), 'Create a <code>/* */</code> style comment that contains at least five letters.');\", \"assert(editor.getValue().match(/(*/)/g), 'Make sure that you close the comment with a <code>*/</code>');\" </del> <ins> \"assert(editor.getValue().match(/(//)...../g), 'Create a <code>//</code> style comment that contains at least five letters');\", \"assert(editor.getValue().match(/(/*)[wW]{5,}(?=*/)/gm), 'Create a <code>/* */</code> style comment that contains at least five letters.');\", \"assert(editor.getValue().match(/(*/)/g), 'Make sure that you close the comment with a <code>*/</code>');\" </ins> ], \"challengeSeed\":[ ],"} | |
| {"_id":"q-en-freeCodeCamp-7936788ce1f56f21685551815bfd3108e2e3c361d3e333fd1bc9ffe56a8a9cf5","text":"<ins> /* global expect jest */ import React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; import TestRenderer from 'react-test-renderer'; import Honesty from './Honesty'; import { Button } from '@freecodecamp/react-bootstrap'; describe('<Honesty />', () => { const renderer = new ShallowRenderer(); const updateIsHonestMock = jest.fn(); test('<Honesty /> snapshot when isHonest is false', () => { const componentToRender = ( <Honesty isHonest={false} updateIsHonest={updateIsHonestMock} /> ); const component = renderer.render(componentToRender); expect(component).toMatchSnapshot('Honesty'); }); test('<Honesty /> snapshot when isHonest is true', () => { const componentToRender = ( <Honesty isHonest={true} updateIsHonest={updateIsHonestMock} /> ); const component = renderer.render(componentToRender); expect(component).toMatchSnapshot('HonestyAccepted'); }); test('should call updateIsHonest method on clicking agree button', () => { const root = TestRenderer.create( <Honesty isHonest={false} updateIsHonest={updateIsHonestMock} /> ).root; root.findByType(Button).props.onClick(); expect(updateIsHonestMock).toHaveBeenCalledWith({ isHonest: true }); }); }); </ins>"} | |
| {"_id":"q-en-freeCodeCamp-7d8f7825da7c622951b5d05717deffc139080a810700edc258d24aa5298c6ef7","text":"</p> <p key={6}> In the situations where we discover instances of unambiguous plagiarism, <del> we will replace the camper in question’s certification with a message </del> <ins> we will replace the person in question’s certification with a message </ins> that \"Upon review, this account has been flagged for academic dishonesty.\" </p>"} | |
| {"_id":"q-en-freeCodeCamp-7e7293c1ab06f77fd0b042c9e8fc1d6ec68fa6cab7c3f020e61ef0ec2434cc9f","text":"`); } catch (err) { if (__userCodeWasExecuted) { <ins> // rethrow error, since test failed. </ins> throw err; <ins> } else { // report errors to dev console (not the editor console, since the test // may still pass) __utils.oldLog(err); </ins> } testResult = eval(e.data.testString); }"} | |
| {"_id":"q-en-freeCodeCamp-7fbe1712d4107e79c1ea2a3de494a4b91d8db96f471b9d2a37b54b5fbe50e37f","text":"function Hotkeys({ canFocusEditor, children, <ins> editorRef, </ins> executeChallenge, introPath, innerRef,"} | |
| {"_id":"q-en-freeCodeCamp-7fbf740543d7f284d0d0212a3479eeb247329026fdf5ee85ddbc06f4f34f1ab5","text":"`myVar = myVar - 1;` should be changed. ```js <del> assert( /lets*myVars*=s*11;s*/*.*s*([-]{2}s*myVar|myVars*[-]{2});/.test(code) ); </del> <ins> assert(!code.match(/myVars*=s*myVars*[-]s*1.*?;?/)); ``` You should not assign `myVar` with `10`. ```js assert(!code.match(/myVars*=s*10.*?;?/)); </ins> ``` You should use the `--` operator on `myVar`."} | |
| {"_id":"q-en-freeCodeCamp-8045111be225a1d07a8c573e7d1088e45ad12396c91e9907c8c798f7a3c7098e","text":"# --description-- <del> Use the `join()` method to combine the `songsHTML` markup into a single string. </del> <ins> Right now the `songsHTML` is an array. If you tried to display this as is, you would see the songs separated by commas. This is not the desired outcome because you want to display the songs as a list. To fix this, you will need to join the array into a single string by using the <dfn>join()</dfn> method. </ins> <del> The `join()` method is used to concatenate all the elements of an array into a single string. It takes an optional parameter called `separator` which is used to separate each element of the array. For example: </del> <ins> The `join()` method is used to concatenate all the elements of an array into a single string. It takes an optional parameter called a `separator` which is used to separate each element of the array. For example: </ins> ```js const exampleArr = [\"This\", \"is\", \"a\", \"sentence\"];"} | |
| {"_id":"q-en-freeCodeCamp-84e91f4ad69ef998f4909e4a27d93e73cc2522aa841579595ca1fea1938618f5","text":"--fcc-editable-region-- function pick(guess) { <del> let numbers = []; </del> <ins> const numbers = []; </ins> while (numbers.length < 10) { numbers.push(Math.floor(Math.random() * 11)); }"} | |
| {"_id":"q-en-freeCodeCamp-8751883c9e6d79d55e0c5d6fc77790dcce695a120d27418e01253a7be408129b","text":".once('error', err => reject(err.message)); }); <del> this._pushTask(task); </del> <ins> this._taskQueue.push(task); this._processQueue(); </ins> return task; } } <ins> // Error and completion handling </ins> const eventify = self => { self._events = {};"} | |
| {"_id":"q-en-freeCodeCamp-87a48cacd457c74c5f0c0dd8d3dabd20a47fe742b34591cd968f65c4734186db","text":"<table> <tr> <del> <td> 此指南可阅读的语言版本 </td> </del> <ins> <!-- Do not translate this table --> <td> Read these guidelines in </td> </ins> <td><a href=\"/CONTRIBUTING.md\"> English </a></td> <del> <td><a href=\"/docs/chinese/CONTRIBUTING.md\"> 中文 </a></td> <td><a href=\"/docs/russian/CONTRIBUTING.md\"> русский </a></td> </del> <td><a href=\"/docs/arabic/CONTRIBUTING.md\"> عربي </a></td> <del> <td><a href=\"/docs/spanish/CONTRIBUTING.md\"> Español </a></td> </del> <ins> <td><a href=\"/docs/chinese/CONTRIBUTING.md\"> 中文 </a></td> </ins> <td><a href=\"/docs/portuguese/CONTRIBUTING.md\"> Português </a></td> <ins> <td><a href=\"/docs/russian/CONTRIBUTING.md\"> Русский </a></td> <td><a href=\"/docs/spanish/CONTRIBUTING.md\"> Español </a></td> <td><a href=\"/docs/greek/CONTRIBUTING.md\"> Ελληνικά </a></td> </ins> </tr> </table>"} | |
| {"_id":"q-en-freeCodeCamp-88d870c03f4b510a9fc91c5497ccfc62a7abc9f06fca5425acd87443abb72029","text":"\"tests\": [ \"assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays');\", \"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays');\", <del> \"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return cthe last chunk as remaining elements');\" </del> <ins> \"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return the last chunk as remaining elements');\" </ins> ] }, {"} | |
| {"_id":"q-en-freeCodeCamp-890cd2e7eec375d5481b3ea55371c5609b935c8d42d4c5b73cdf7badfcb241fd","text":"## --sentence-- <del> `_ to _ you all. I'm David, the project _ from FCC _.` </del> <ins> `_ to _ you all. I'm David, the project _ from FCC _` </ins> ## --blanks--"} | |
| {"_id":"q-en-freeCodeCamp-8c663fbc2424d49ffceda18cccda30999f75260b2a20d71eda722b46e182e100","text":"className=\"spacer\" style={ { <del> \"height\": \"1px\", </del> \"padding\": \"5px 0\", } }"} | |
| {"_id":"q-en-freeCodeCamp-8dd68b874a9bd5c36fe29d682013497115f9d58176c92caccc7e44eccc592d4d","text":"\"// Only change code above this line.\", \"// We use this function to show you the value of your variable in your output box.\", \"// You'll learn about functions soon.\", <del> \"if(typeof(myArray) !== \"undefined\" && typeof(data) !== \"undefined\"){(function(y,z){return('myArray = ' + JSON.stringify(y) + ', data = ' + JSON.stringify(z));})(myArray, data);}\" </del> <ins> \"if(typeof(myArray) !== \"undefined\" && typeof(myData) !== \"undefined\"){(function(y,z){return('myArray = ' + JSON.stringify(y) + ', myData = ' + JSON.stringify(z));})(myArray, myData);}\" </ins> ], \"type\": \"waypoint\", \"challengeType\": 1"} | |
| {"_id":"q-en-freeCodeCamp-8dde42ad3474ee8e84c570d51111fedc67514919f6bed769abdf64becd5d5740","text":"# --description-- <del> Within the arrow function of the event listener, add an `if` to check if `userData?.currentSong` is `falsey`. </del> <ins> Within the arrow function of the event listener, add an `if` to check if `userData?.currentSong` is `null`. </ins> Inside the `if` block, call the `playSong()` function with the `id` of the first song in the `userData?.songs` array. This will ensure the first song in the playlist is played first. # --hints-- <del> You should create an `if` statement with the condition `!userData?.currentSong`. </del> <ins> You should create an `if` statement with the condition `userData?.currentSong === null`. </ins> ```js <del> assert.match(code, /ifs*((s*!userData?.currentSongs*|s*userData?.currentSongs*===s*nulls*|s*userData?.currentSongs*===s*undefineds*))s*{/) </del> <ins> assert.match(code, /ifs*(s*userData?.currentSongs*===s*nulls*)s*{/); </ins> ``` You should call the `playSong` function with `userData?.songs[0].id` inside your `if` block. ```js <del> assert.match(code, /ifs*((s*!userData?.currentSongs*|s*userData?.currentSongs*===s*nulls*|s*userData?.currentSongs*===s*undefineds*))s*{s*playSong(s*userData?.songss*[s*0s*]s*.ids*)s*;?s*}/) </del> <ins> assert.match(code, /ifs*(s*userData?.currentSongs*===s*nulls*)s*{s*playSong(s*userData?.songss*[s*0s*]s*.ids*)s*;?s*}/); </ins> ``` # --seed--"} | |
| {"_id":"q-en-freeCodeCamp-92f53e34cb3889d635801afaf0fd636f701d594a8ac8a4afc9a0f74bb098f2d8","text":"> <Caret /> <h4> <del> Super Block One Certification (300 hours) </del> <ins> Super Block One Certification (300 hours) </ins> </h4> </button> <ul>"} | |
| {"_id":"q-en-freeCodeCamp-93bbbb6646f18cb87b721b5526fa566a204792738692b6c676d6b26bf5d7fecf","text":"You also need to get the value of your `#budget` input. You already queried this at the top of your code, and set it to the `budgetNumberInput` variable. However, you used `getElementById`, which returns an `Element`, not a `NodeList`. <del> A `NodeList` is an array-like, which means you can iterate through it and it shares some common methods with an array. For your `getCaloriesFromInputs` function, an array will work for the argument just as well as a `NodeList` does. </del> <ins> A `NodeList` is an array-like object, which means you can iterate through it and it shares some common methods with an array. For your `getCaloriesFromInputs` function, an array will work for the argument just as well as a `NodeList` does. </ins> Declare a `budgetCalories` variable and set it to the result of calling `getCaloriesFromInputs` – pass an array containing your `budgetNumberInput` as the argument."} | |
| {"_id":"q-en-freeCodeCamp-944439d31b666a831932cbfc42c5991ef287f232766dfa9a8e69170643094290","text":"padding-top: 15px; } <del> .honesty-policy .agreed { display: flex; justify-content: center; align-items: center; background-color: var(--quaternary-color); color: #fff; } div .agreed p { color: white; } .honesty-policy .agreed p { </del> <ins> .honesty-policy .disabled-agreed p { </ins> margin-top: 0; margin-bottom: 0; }"} | |
| {"_id":"q-en-freeCodeCamp-9853f84866eb2ba8b031d87436f3a62045bf393730bdaea843ee94b4bbbb4a14","text":"Editor.displayName = 'Editor'; Editor.propTypes = propTypes; <ins> // NOTE: withRef gets replaced by forwardRef in react-redux 6, // https://github.com/reduxjs/react-redux/releases/tag/v6.0.0 </ins> export default connect( mapStateToProps, <del> mapDispatchToProps </del> <ins> mapDispatchToProps, null, { withRef: true } </ins> )(Editor);"} | |
| {"_id":"q-en-freeCodeCamp-99b10fdd27764e9a299e15c70857343514545c6703f27110e1f04896650b6da2","text":"}; ``` <del> When the `#search-input` element contains the value `94` and the `#search-button` element is clicked, the `#types` element should contain two inner elements with the text values `GHOST` and `POISON`, respectively. Make sure the `#type` element content is cleared between searches. </del> <ins> When the `#search-input` element contains the value `94` and the `#search-button` element is clicked, the `#types` element should contain two inner elements with the text values `GHOST` and `POISON`, respectively. Make sure the `#types` element content is cleared between searches. </ins> ```js async () => {"} | |
| {"_id":"q-en-freeCodeCamp-9a0b7a65d9f8ab83d19d1271c926c80adaf2b03d4c22d8cd163fd2e1d6311c3f","text":"challengeFile && ( <Editor containerRef={this.containerRef} <ins> ref={this.editorRef} </ins> {...challengeFile} fileKey={challengeFile.key} />"} | |
| {"_id":"q-en-freeCodeCamp-9bf42eabd9cd044ff84bc96833a33fbcef7e8ab459a3252766367123545ba6c6","text":"on: workflow_dispatch: schedule: <del> # runs every weekday at 12:00 noon UTC - cron: '0 12 * * 1-5' </del> <ins> # runs Monday and Wednesday at 12:15 PM UTC - cron: '15 12 * * 1,3' </ins> env: GITHUB_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}"} | |
| {"_id":"q-en-freeCodeCamp-9e3c60a71e6983977784146ff6f09e24344a004be9766870052c10d924a04c80","text":"export type Test = { pass?: boolean; err?: string; <ins> message?: string; </ins> } & (ChallengeTest | CertTest); export type ChallengeTest = {"} | |
| {"_id":"q-en-freeCodeCamp-a025f1281a4228a281593c9d19f5e57548e8d6b0b5d445be8215fe1c5e75ee89","text":"}; ``` <del> When the `#search-input` element contains the value `Pikachu` and the `#search-button` element is clicked, the `#types` element should contain a single inner element with the value `ELECTRIC`. Make sure the `#type` element content is cleared between searches. </del> <ins> When the `#search-input` element contains the value `Pikachu` and the `#search-button` element is clicked, the `#types` element should contain a single inner element with the value `ELECTRIC`. Make sure the `#types` element content is cleared between searches. </ins> ```js async () => {"} | |
| {"_id":"q-en-freeCodeCamp-a2c0f37dc9a2a4f481386b3a48d730f9264847a2cf2124690ffd2fb52f531ae7","text":".tool-panel-group-mobile button, .tool-panel-group-mobile a { <del> font-size: 16px; </del> <ins> font-size: 0.8rem; </ins> } .tool-panel-group-mobile {"} | |
| {"_id":"q-en-freeCodeCamp-a6332f034708b7b2bcf4b37500b8065f237921be604fd8cc807aeef3c0cc2e11","text":"Inside the callback function, create a new `const` variable called `collisionDetectionRules` and assign it an empty array. <del> Inside that array, add a conditional statement that checks if the player's `y` position plus the player's height is less than or equal to the platform's `y` position. </del> <ins> Inside that array, add a boolean expression that checks if the player's `y` position plus the player's height is less than or equal to the platform's `y` position. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-a9fcf30048364f5f6d1fd803694e41189c85239ec4e78268aa438b3e6aa45002","text":"/* eslint-disable @typescript-eslint/no-unsafe-member-access */ <del> import { setupServer, superRequest } from '../../jest.utils'; </del> <ins> import { setupServer, superRequest, createSuperRequest } from '../../jest.utils'; </ins> import { AUTH0_DOMAIN } from '../utils/env'; <ins> const mockedFetch = jest.fn(); jest.spyOn(globalThis, 'fetch').mockImplementation(mockedFetch); const newUserEmail = '[email protected]'; const mockAuth0NotOk = () => ({ ok: false }); const mockAuth0InvalidEmail = () => ({ ok: true, json: () => ({ email: 'invalid-email' }) }); const mockAuth0ValidEmail = () => ({ ok: true, json: () => ({ email: newUserEmail }) }); </ins> jest.mock('../utils/env', () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-return return {"} | |
| {"_id":"q-en-freeCodeCamp-aa114097567e0ac023bc97f25fe1725038da06a6b075497b4b0292e6abbb437c","text":"export const handleRequest = (makeRequest: () => Promise<Response>) => () => { makeRequest() <del> .then(res => res.json() as Promise<{ stdout: string; stderr: string }>) .then(data => alert(JSON.stringify(data))) </del> <ins> .then( res => res.json() as Promise<{ stdout?: string; stderr?: string; message?: string; }> ) .then(data => { if (data.message) { alert(data.message); } else { alert(JSON.stringify(data)); } }) </ins> .catch(err => console.error(err)); };"} | |
| {"_id":"q-en-freeCodeCamp-aa500c433f71ec9aa011f911966598d871695b0bfae55cd0a02fecbf2d333678","text":"], \"tests\": [ [ <del> \"Algorithms expressed exponentially like O(N^2) can work well in certain situations, so you shouldn't avoid them completely.\", </del> <ins> \"Algorithms expressed exponentially like O(C^N), where C is a constant can work well in certain situations, so you shouldn't avoid them completely.\", </ins> false, \"While they can work in certain small scale situations, they aren't good practice because they will not work larger scale.\" ],"} | |
| {"_id":"q-en-freeCodeCamp-ac8478440e9836c7cbf6763c48c25b0b2e7dabe8dd770cb647a077b4376b3bef","text":"</div> <div class=\"spacer\" <del> style=\"padding: 15px 0px; height: 1px;\" </del> <ins> style=\"padding: 15px 0px;\" </ins> /> <div class=\"text-center row\""} | |
| {"_id":"q-en-freeCodeCamp-ae59debef22dc0e60df22045c2d8bcc6370e597aff2f2bca504a1539cb0b9a23","text":"}; this.containerRef = React.createRef(); <ins> this.editorRef = React.createRef(); </ins> } onResize() { this.setState({ resizing: true });"} | |
| {"_id":"q-en-freeCodeCamp-af1a927d1cb777360644472e238a0b9e13cee901b7fe92db853834b4b819eca4","text":"<del> import React, { Fragment } from 'react'; </del> <ins> import React, { Fragment, Component } from 'react'; import Prism from 'prismjs'; </ins> import PropTypes from 'prop-types'; import './challenge-description.css';"} | |
| {"_id":"q-en-freeCodeCamp-af1af77476f5d443845029242e0caf671c10b3f7110edb4f85baea25e3c5689b","text":"} const onChange = (editorValue: string) => { <del> const { updateFile, fileKey } = props; </del> <ins> const { updateFile, fileKey, isResetting } = props; if (isResetting) return; </ins> // TODO: now that we have getCurrentEditableRegion, should the overlays // follow that directly? We could subscribe to changes to that and redraw if // those imply that the positions have changed (i.e. if the content height"} | |
| {"_id":"q-en-freeCodeCamp-af740a40e8e683fc8cd53f86af7034b575f2b8b200d8dbbecbdf65d95cd5ad3d","text":"function createSuperBlockTitle(str) { return codingPrepRE.test(str) ? `${str} (Thousands of hours of challenges)` <del> : `${str} Certification (300 hours)`; </del> <ins> : `${str} Certification (300xa0hours)`; </ins> } export class SuperBlock extends Component {"} | |
| {"_id":"q-en-freeCodeCamp-b094147798517de9ee92d01edea5c97befc5dabc7e1b08b3a1ff2b94a70b1396","text":"# --description-- <del> **Objective:** Build an app that is functionally similar to this: <a href=\"https://codepen.io/freeCodeCamp/full/KaNGNR\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://codepen.io/freeCodeCamp/full/KaNGNR</a>. </del> <ins> **Objective:** Build an app that is functionally similar to this: <a href=\"https://treemap-diagram.freecodecamp.rocks\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://treemap-diagram.freecodecamp.rocks</a>. </ins> 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."} | |
| {"_id":"q-en-freeCodeCamp-b0c2c3555e79a1da7f275b5e22c4e839d074a957b6d26ae0c962deafecaa4f45","text":"\"assert.strictEqual(Enzyme.mount(React.createElement(MagicEightBall)).children().childAt(2).name(), 'button', 'message: <code>MagicEightBall</code>'s third child should be a <code>button</code> element.');\", \"assert(Enzyme.mount(React.createElement(MagicEightBall)).state('randomIndex') === '' && Enzyme.mount(React.createElement(MagicEightBall)).state('userInput') === '', 'message: <code>MagicEightBall</code>'s state should be initialized with a property of <code>userInput</code> and a property of <code>randomIndex</code> both set to a value of an empty string.');\", \"assert(Enzyme.mount(React.createElement(MagicEightBall)).find('p').length === 1 && Enzyme.mount(React.createElement(MagicEightBall)).find('p').text() === '', 'message: When <code>MagicEightBall</code> is first mounted to the DOM, it should return an empty <code>p</code> element.');\", <del> \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(MagicEightBall)); const simulate = () => { comp.find('input').simulate('change', { target: { value: 'test?' }}); comp.find('button').simulate('click'); }; const result = () => comp.find('p').text(); const _1 = () => { simulate(); return waitForIt(() => result()) }; const _2 = () => { simulate(); return waitForIt(() => result()) }; const _3 = () => { simulate(); return waitForIt(() => result()) }; const _4 = () => { simulate(); return waitForIt(() => result()) }; const _5 = () => { simulate(); return waitForIt(() => result()) }; const _6 = () => { simulate(); return waitForIt(() => result()) }; const _7 = () => { simulate(); return waitForIt(() => result()) }; const _8 = () => { simulate(); return waitForIt(() => result()) }; const _9 = () => { simulate(); return waitForIt(() => result()) }; const _10 = () => { simulate(); return waitForIt(() => result()) }; const _1_val = await _1(); const _2_val = await _2(); const _3_val = await _3(); const _4_val = await _4(); const _5_val = await _5(); const _6_val = await _6(); const _7_val = await _7(); const _8_val = await _8(); const _9_val = await _9(); const _10_val = await _10(); const actualAnswers = [_1_val, _2_val, _3_val, _4_val, _5_val, _6_val, _7_val, _8_val, _9_val, _10_val]; const hasIndex = actualAnswers.filter((answer, i) => possibleAnswers.indexOf(answer) !== -1); const notAllEqual = new Set(actualAnswers); assert(notAllEqual.size > 1 && hasIndex.length === 10, 'message: When text is entered into the <code>input</code> element and the button is clicked, the <code>MagicEightBall</code> component should return a <code>p</code> element that contains a random element from the <code>possibleAnswers</code> array.'); \" </del> <ins> \"async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(MagicEightBall)); const simulate = () => { comp.find('input').simulate('change', { target: { value: 'test?' }}); comp.find('button').simulate('click'); }; const result = () => comp.find('p').text(); const _1 = () => { simulate(); return waitForIt(() => result()) }; const _2 = () => { simulate(); return waitForIt(() => result()) }; const _3 = () => { simulate(); return waitForIt(() => result()) }; const _4 = () => { simulate(); return waitForIt(() => result()) }; const _5 = () => { simulate(); return waitForIt(() => result()) }; const _6 = () => { simulate(); return waitForIt(() => result()) }; const _7 = () => { simulate(); return waitForIt(() => result()) }; const _8 = () => { simulate(); return waitForIt(() => result()) }; const _9 = () => { simulate(); return waitForIt(() => result()) }; const _10 = () => { simulate(); return waitForIt(() => result()) }; const _1_val = await _1(); const _2_val = await _2(); const _3_val = await _3(); const _4_val = await _4(); const _5_val = await _5(); const _6_val = await _6(); const _7_val = await _7(); const _8_val = await _8(); const _9_val = await _9(); const _10_val = await _10(); const actualAnswers = [_1_val, _2_val, _3_val, _4_val, _5_val, _6_val, _7_val, _8_val, _9_val, _10_val]; const hasIndex = actualAnswers.filter((answer, i) => possibleAnswers.indexOf(answer) !== -1); const notAllEqual = new Set(actualAnswers); assert(notAllEqual.size > 1 && hasIndex.length === 10, 'message: When text is entered into the <code>input</code> element and the button is clicked, the <code>MagicEightBall</code> component should return a <code>p</code> element that contains a random element from the <code>possibleAnswers</code> array.');}\" </ins> ], \"solutions\": [ \"nconst inputStyle = {n width: 235,n margin: 5n}nnclass MagicEightBall extends React.Component {n constructor(props) {n super(props);n this.state = {n userInput: '',n randomIndex: ''n }n this.ask = this.ask.bind(this);n this.handleChange = this.handleChange.bind(this);n }n ask() {n if (this.state.userInput) {n this.setState({n randomIndex: Math.floor(Math.random() * 20),n userInput: ''n });n }n }n handleChange(event) {n this.setState({n userInput: event.target.valuen });n }n render() {n const possibleAnswers = [n \"It is certain\", \"It is decidedly so\", \"Without a doubt\",n \"Yes, definitely\", \"You may rely on it\", \"As I see it, yes\",n \"Outlook good\", \"Yes\", \"Signs point to yes\", \"Reply hazy try again\",n \"Ask again later\", \"Better not tell you now\", \"Cannot predict now\",n \"Concentrate and ask again\", \"Don't count on it\", \"My reply is no\",n \"My sources say no\", \"Outlook not so good\",\"Very doubtful\", \"Most likely\"n ];n const answer = possibleAnswers[this.state.randomIndex];n return (n <div>n <inputn type=\"text\"n value={this.state.userInput}n onChange={this.handleChange}n style={inputStyle} /><br />n <button onClick={this.ask}>Ask the Magic Eight Ball!</button><br />n <h3>Answer:</h3>n <p>n {answer}n </p>n </div>n );n }n};\""} | |
| {"_id":"q-en-freeCodeCamp-b0f8df4110ac5f7ac7c09c78121396fd6e7b1152bda7321bf98fa5114376fb40","text":"// Change code above this line } } <del> const newBookList = add(bookList, 'A Brief History of Time'); const newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies'); const newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies'); console.log(bookList); </del> ``` # --solutions--"} | |
| {"_id":"q-en-freeCodeCamp-b2175afa92276d0dc7d048ddbe0780d9f87ea42f39fe6cacac3c81dc5a2796ca","text":"<ins> --- title: Gatsby.js --- ## Gatsby.js [Gatsby](https://www.gatsbyjs.org) is a static site generator for [React](https://guide.freecodecamp.org/react), powered by [GraphQL](https://graphql.org/). Gatsby loads only the critical HTML, CSS, data, and JavaScript so your site loads as fast as possible. Once loaded, Gatsby prefetches resources for other pages so clicking around the site feels incredibly fast. The Gatsby environment provides several \"starters\" to help configure static sites quickly. Starters can be found here: [Starter Library](https://www.gatsbyjs.org/starters/). ### How Gatsby works Gatsby builds sites with the data provided by the developer, regardless of the source. #### Data sources Gatsby accepts the data behind the site in various formats, such as: 1. CMSs: Wordpress, Contentful, Drupal, etc. 2. Markdown: Documentation, posts, etc. 3. Data: APIs, Databases, JSON, CSV, etc. #### Build Gatsby's build is powered by GraphQL and rendered through HTML, CSS, and React. Since Gatsby is built on React you straight away get all the things we love about React, like composability, one-way binding, reusability, great environment and allows you to query your data however you want! #### Deploy Gatsby deploys the site on a static web host such as Amazon S3, Netlify, GitHub Pages, Surge.sh and many more. ### Installation and using the Gatsby CLI * Node: `npm install --global gatsby-cli` * Get started with the official Gatsby starter: `gatsby new gatsby-site https://github.com/gatsbyjs/gatsby-starter-default` * After that change to the newly created directory `cd gatsby-site` * `gatsby develop` starts a hot-reloading development server at `localhost:8000`. The site will reload when changes in `src/pages` will be saved. * To generate the static HTML pages use `gatsby build` * `gatsby serve` will start a local server that will present your built site. ### Querying data You are accessing all data by writing GraphQL queries. GraphQL allows you to pull only the data you need into your components, unlike when fetching data from REST API. A detailed walkthrough is available at https://www.gatsbyjs.org/tutorial/part-four/?no-cache=1#how-gatsbys-data-layer-uses-graphql-to-pull-data-into-components. #### More Information: For tutorials and more information check out the Gatsby.js official site: [Gatsby.js official site](https://www.gatsbyjs.org/tutorial/) </ins>"} | |
| {"_id":"q-en-freeCodeCamp-b23652f10fd30db1037e5be50691eedd9f72e1e8f50663289a677663e3df8d54","text":"# --description-- <del> **Objective:** Build an app that is functionally similar to this: <a href=\"https://codepen.io/freeCodeCamp/full/GrZVaM\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://codepen.io/freeCodeCamp/full/GrZVaM</a>. </del> <ins> **Objective:** Build an app that is functionally similar to this: <a href=\"https://bar-chart.freecodecamp.rocks\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://bar-chart.freecodecamp.rocks</a>. </ins> 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."} | |
| {"_id":"q-en-freeCodeCamp-b322dc97157bd3130a1bea1b9f4d2cfbe0dd031642502b14554fb3a42d9a64f7","text":"- text: <code>functionWithArgs(7,9)</code> should output <code>16</code> testString: if(typeof functionWithArgs === \"function\") { capture(); functionWithArgs(7,9); uncapture(); } assert(logOutput == 16); - text: Call <code>functionWithArgs</code> with two numbers after you define it. <del> testString: assert(/^s*functionWithArgss*(s*d+s*,s*d+s*)s*;/m.test(code)); </del> <ins> testString: assert(/^s*functionWithArgss*(s*d+s*,s*d+s*)s*/m.test(code)); </ins> ```"} | |
| {"_id":"q-en-freeCodeCamp-b32799d67d32b17452d1e13e717598ad211f62f0a5a00e91da4c4d6a5a828ff7","text":"\"All related radio buttons should have the same <code>name</code> attribute.\", \"Here's an example of a radio button:\", \"<code><label><input type=\"radio\" name=\"indoor-outdoor\"> Indoor</label></code>\", <del> \"Add to your form a pair of radio buttons. Each radio button should be nested within its own <code>label</code> element. They should share a common <code>name</code> attribute. One should have the option of <code>indoor</code> and the other should have the option of <code>outdoor</code>.\" </del> <ins> \"Add a pair of radio buttons to your form. One should have the option of <code>indoor</code> and the other should have the option of <code>outdoor</code>.\" </ins> ], \"tests\": [ \"assert($('input[type=\"radio\"]').length > 1, 'Your page should have two radio button elements.')\","} | |
| {"_id":"q-en-freeCodeCamp-b644598aaa0a8e2004be60827fe16a5c3945dc16e3f02c6bc440e3aacf250af3","text":"return ` <li id=\"song-${song.id}\" class=\"playlist-song\"> --fcc-editable-region-- <del> <button class=\"playlist-song-info\" onclick=\"playSong(${song.id})\"> </del> <ins> <button class=\"playlist-song-info\"> </ins> <span class=\"playlist-song-title\">${song.title}</span> <span class=\"playlist-song-artist\">${song.artist}</span> <span class=\"playlist-song-duration\">${song.duration}</span>"} | |
| {"_id":"q-en-freeCodeCamp-b776637ba9b70536e85baf365d896694f81ec78bee67b9f249365cc86bcf555e","text":"\"title\": \"Add ID Attributes to Bootstrap Elements\", \"description\": [ \"Recall that in addition to class attributes, you can give each of your elements an <code>id</code> attribute.\", <del> \"Each id should be unique to a specific element.\", </del> <ins> \"Each id must be unique to a specific element and used only once per page.\", </ins> \"Let's give a unique id to each of our <code>div</code> elements of class <code>well</code>.\", \"Remember that you can give an element an id like this: <code><div class=\"well\" id=\"center-well\"></code>\", \"Give the well on the left the id of <code>left-well</code>. Give the well on the right the <code>id</code> of <code>right-well</code>.\""} | |
| {"_id":"q-en-freeCodeCamp-b7878af7db1cb060cd6030d11bff7d250e3c2cc738172aab92198e3445b05a83","text":"newTest.stack = stack; } <del> newTest.message = newTest.message.replace(/<p>/, `<p>${i + 1}. `); yield put(updateConsole(newTest.message)); </del> <ins> const withIndex = newTest.message.replace(/<p>/, `<p>${i + 1}. `); yield put(updateConsole(withIndex)); </ins> } finally { testResults.push(newTest); }"} | |
| {"_id":"q-en-freeCodeCamp-b7f6aae93d631e9a3a36a75cf58bae907a2275607a26412939cd3e3137a94065","text":"return ( <Fragment> <Helmet> <del> <title>Report a users profile | freeCodeCamp.org</title> </del> <ins> <title>Report a users portfolio | freeCodeCamp.org</title> </ins> </Helmet> <Spacer size={2} /> <Row className='text-center'> <Col sm={8} smOffset={2} xs={12}> <h2> Do you want to report {username} <del> 's profile for abuse? </del> <ins> 's portfolio for abuse? </ins> </h2> </Col> </Row>"} | |
| {"_id":"q-en-freeCodeCamp-b98ea421c29de1bedcee6c2eb91e8e133f316971a76e54db336e056f9829b030","text":"return isSessionUser ? ( <Fragment> <FullWidthRow> <del> <h2 className='text-center'>You have not made your profile public.</h2> </del> <ins> <h2 className='text-center'> You have not made your portfolio public. </h2> </ins> </FullWidthRow> <FullWidthRow> <p className='alert alert-info'> <del> You need to change your privacy setting in order for your profile to be seen by others. This is a preview of how your profile will look </del> <ins> You need to change your privacy setting in order for your portfolio to be seen by others. This is a preview of how your portfolio will look </ins> when made public. </p> </FullWidthRow>"} | |
| {"_id":"q-en-freeCodeCamp-bac2351c33ad237b231be01eb7bda3923b8ce821eca7db816a17ad5cce142eb4","text":"let alertMessage; window.alert = (message) => alertMessage = message; // Override alert and store message <del> const randomValidPokeId = Math.floor(Math.random() * 1025) + 1; </del> <ins> const randomValidPokeId = String(Math.floor(Math.random() * 1025) + 1); </ins> searchInput.value = randomValidPokeId; searchInput.dispatchEvent(new Event('change')); searchButton.click(); <del> const res = await fetch('https://pokeapi-proxy.freecodecamp.rocks/api/pokemon/' + randomValidPokeId.toString()); // Fetch from proxy to simulate network delay </del> <ins> const res = await fetch('https://pokeapi-proxy.freecodecamp.rocks/api/pokemon/' + randomValidPokeId); // Fetch from proxy to simulate network delay </ins> if (res.ok) { <del> await new Promise(resolve => setTimeout(resolve, 1000)); // Additional delay to allow UI to update </del> <ins> await new Promise(resolve => setTimeout(resolve, 2000)); // Additional delay to allow UI to update </ins> <del> const data = await res.json(); const typesEl = document.getElementById('types'); const actualTypes = data.types.map(typeSlot => typeSlot.type.name); </del> <ins> const data = await res.json(); const typesEl = document.getElementById('types'); const actualTypes = data.types.map(typeSlot => typeSlot.type.name); </ins> assert.lengthOf(typesEl.children, actualTypes.length); assert.sameMembers(actualTypes, [...typesEl.children].map(el => el.innerText.trim().toLowerCase())); } } catch (err) {"} | |
| {"_id":"q-en-freeCodeCamp-bc3c8ec76f77996c6368a52c28e3b34d39c6de303f3fa6a53c615247746e4c45","text":"id: bad87fee1348bd9aecf08801 title: Introduction to HTML5 Elements challengeType: 0 <del> videoUrl: 'https://scrimba.com/p/pVMPUv/c4Ep9Am' </del> <ins> videoUrl: 'https://scrimba.com/p/pVMPUv/cBkZGpt7' </ins> --- ## Description"} | |
| {"_id":"q-en-freeCodeCamp-bcfeaf05ec44755b6e717681ea74a1cbb22ac1eee967b6287368e1c0c643daac","text":"\"  <code><li>cheese</li></code>\", \"<code></ul></code>\", \"would create a bullet point-style list of \"milk\" and \"cheese\".\", <del> \"Replace your <code>p</code> elements with an unordered list of three things that cats love.\" </del> <ins> \"Remove the last two <code>p</code> elements and create an unordered list of three things that cats love at the bottom of the page.\" </ins> ], \"tests\": [ \"assert($(\"ul\").length > 0, 'Create a <code>ul</code> element.')\","} | |
| {"_id":"q-en-freeCodeCamp-bf0b29fa7b939185a542d641f6ed8c22f78c3d6026bc65712dec052fe9003245","text":"\"cert-map-estimates\": { \"certs\": \"Certificación (300 horas)\", \"coding-prep\": \"(Miles de horas de desafíos)\" <ins> }, \"editor-tabs\": { \"info\": \"Información\", \"code\": \"Código\", \"tests\": \"Pruebas\", \"preview\": \"Avance\" </ins> } }, \"donate\": {"} | |
| {"_id":"q-en-freeCodeCamp-c0e051a3a87be394d29dd6e183c003520275b44ccea80ece196326579202820a","text":"\"id\": \"bad87fee1348cd8acef08812\", \"title\": \"Create a Block Element Bootstrap Button\", \"description\": [ <del> \"Normally, your <code>button</code> elements are only as wide as the text that they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space.\", </del> <ins> \"Normally, your <code>button</code> elements are only as wide as the text that they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space and any elements following it will flow onto a \"new line\" below the block.\", </ins> \"This image illustrates the difference between <code>inline</code> elements and <code>block-level</code> elements:\", \"<a href=\"http://i.imgur.com/O32cDWE.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" src=\"http://i.imgur.com/O32cDWE.png\" title=\"Click to enlarge\" alt=\"An \"inline\" button is as small as the text it contains. In this image, it's centered. Below it is a \"block-level\" button, which stretches to fill the entire horizontal space.'></a>\", \"Note that these buttons still need the <code>btn</code> class.\","} | |
| {"_id":"q-en-freeCodeCamp-c10ed0c73dae16a160a6c8a0df2e25c313e857aaebaa3c0a0b8f536dc27c3df4","text":"], \"challengeSeed\":[ \"//var ourDog = {\", <del> \"// \"name\": \"Camper\"\", \"// \"legs\": 4\", \"// \"tails\": 1\", </del> <ins> \"// \"name\": \"Camper\",\", \"// \"legs\": 4,\", \"// \"tails\": 1,\", </ins> \"// \"friends\": [\"everything!\"]\", \"//};\", \"\","} | |
| {"_id":"q-en-freeCodeCamp-c3f7bf7a98caead583cf43e26000c9906cc722510b79804a0faf10144186de56","text":"export function insertEditableRegions(challengeFiles = []) { if (challengeFiles?.some(file => file.editableRegionBoundaries?.length > 0)) { const editableRegionStrings = fileExtension => { <del> const startComment = fileExtension === 'html' ? '<!--' : '/*'; const endComment = fileExtension === 'html' ? '-->' : '*/'; return `n${startComment} User Editable Region ${endComment}n`; </del> <ins> switch (fileExtension) { case 'html': return 'n<!-- User Editable Region -->n'; case 'css': return 'n/* User Editable Region */n'; case 'py': return 'n# User Editable Regionn'; case 'js': return 'n// User Editable Regionn'; default: return 'nUser Editable Regionn'; } </ins> }; const filesWithEditableRegions = challengeFiles.map(file => {"} | |
| {"_id":"q-en-freeCodeCamp-c4a63f5c0589d274c8662a1d99c3ed967ce98172344086a02cc3c20927eded6d","text":"`bookList` should not change and still equal `[\"The Hound of the Baskervilles\", \"On The Electrodynamics of Moving Bodies\", \"Philosophiæ Naturalis Principia Mathematica\", \"Disquisitiones Arithmeticae\"]`. ```js <ins> add(bookList, \"Test\"); </ins> assert( JSON.stringify(bookList) === JSON.stringify(["} | |
| {"_id":"q-en-freeCodeCamp-c4b99870533c84a92af3ec991ce4d088f191d41b7c6cc50b77d64c2609afef11","text":"}; this._editor = null; <ins> this.focusOnEditor = this.focusOnEditor.bind(this); </ins> } editorWillMount = monaco => {"} | |
| {"_id":"q-en-freeCodeCamp-c523814cec6cb858e109c7a1b06b24cd7c29105d21ced0acf27bb851a145c8ae","text":"import { createSelector } from 'reselect'; import { executeChallenge, updateFile } from '../redux'; <del> import { userSelector } from '../../../redux'; </del> <ins> import { userSelector, isDonationModalOpenSelector } from '../../../redux'; </ins> import { Loader } from '../../../components/helpers'; const MonacoEditor = React.lazy(() => import('react-monaco-editor')); const propTypes = { <ins> canFocus: PropTypes.bool, </ins> contents: PropTypes.string, dimensions: PropTypes.object, executeChallenge: PropTypes.func.isRequired,"} | |
| {"_id":"q-en-freeCodeCamp-c5ac47e73c708d7efd69b0cac70ba4338daff011f392b5e752d8255d87f4404e","text":"], \"challengeSeed\":[ \"// var ourDog = {\", <del> \"// \"name\": \"Camper\"\", \"// \"legs\": 4\", \"// \"tails\": 1\", </del> <ins> \"// \"name\": \"Camper\",\", \"// \"legs\": 4,\", \"// \"tails\": 1,\", </ins> \"// \"friends\": [\"everything!\"]\", \"// };\", \"\","} | |
| {"_id":"q-en-freeCodeCamp-c5f50d97e8e54f63812754f6431892ec86360f2b6e5e30b29e4e6dde979a9cf6","text":"<del> --- title: Gatsby.js --- ## Gatsby.js [Gatsby](https://www.gatsbyjs.org) is a static site generator for [React](https://guide.freecodecamp.org/react), powered by [GraphQL](https://graphql.org/). Gatsby loads only the critical HTML, CSS, data, and JavaScript so your site loads as fast as possible. Once loaded, Gatsby prefetches resources for other pages so clicking around the site feels incredibly fast. The Gatsby environment provides several \"starters\" to help configure static sites quickly. Starters can be found here: [Starter Library](https://www.gatsbyjs.org/starters/). ### How Gatsby works Gatsby builds sites with the data provided by developer, regardless of the source. #### Data sources Gatsby accepts the data behind the site in various formats, such as: 1. CMSs: Wordpress, Contenful, Drupal, etc. 2. Markdown: Documentation, posts, etc. 3. Data: APIs, Databasses, JSON, CSV, etc. #### Build Gatsby's build is powered by GraphQL and rendered through HTML, CSS, and React. Since Gatsby is built on React you straight away get all the things we love about React, like composability, one-way binding, resuability, great environment and allows you to query your data however you want! #### Deploy Gatsby deploys the site on a static web host such as Amazon S3, Netlify, GitHub Pages, Surge.sh and many more. ### Installation and using the Gatsby CLI * Node: `npm install --global gatsby-cli` * Get started with the official Gatsby starter: `gatsby new gatsby-site https://github.com/gatsbyjs/gatsby-starter-default` * After that change to the newly created directory `cd gatsby-site` * `gatsby develop` starts a hot-reloading development server at `localhost:8000`. The site will reload when changes in `src/pages` will be saved. * To generate the static HTML pages use `gatsby build` * `gatsby serve` will start a local server that will present your built site. ### Querying data You are accessing all data by writing GraphQL queries. GraphQL allows you to pull only the data you need into your components, unlike when fetching data from REST API. A detailed walktrough is available at https://www.gatsbyjs.org/tutorial/part-four/?no-cache=1#how-gatsbys-data-layer-uses-graphql-to-pull-data-into-components. #### More Information: For tutorials and more information check out the Gatsby.js official site: [Gatsby.js official site](https://www.gatsbyjs.org/tutorial/) </del>"} | |
| {"_id":"q-en-freeCodeCamp-cafc2b0207485889139df9a98ad3f1b4a45d651edc7c303ac79b14a70fd7bbd8","text":"<div style=\"width: 100%; text-align: center;\"> <svg xmlns=\"https://www.w3.org/2000/svg\" xmlns:xlink=\"https://www.w3.org/1999/xlink\" width=\"520\" height=\"170\" aria-hidden=\"true\" alt=\"Diagram showing the possible paths for 2 by 2 and 4 by 3 rectangles\"> <style> <del> .g { fill: none; stroke: #ccc } .s, .s2 { fill: #bff; stroke: black; fill-opacity: .4 } .s2 { fill: #fbf } .d { stroke:black; fill:none} </del> <ins> .diagram-g { fill: none; stroke: #ccc } .diagram-s, .diagram-s2 { fill: #bff; stroke: black; fill-opacity: .4 } .diagram-s2 { fill: #fbf } .diagram-d { stroke:black; fill:none} </ins> </style> <del> <defs>\t<g id=\"m\"> <g id=\"h4\"><g id=\"h2\"> <path id=\"h\" d=\"m0 10h 640\" class=\"g\"/> <use xlink:href=\"#h\" transform=\"translate(0,20)\"/></g> <use xlink:href=\"#h2\" transform=\"translate(0, 40)\"/></g> <use xlink:href=\"#h4\" transform=\"translate(0,80)\"/> <g id=\"v8\"><g id=\"v4\"><g id=\"v2\"> <path id=\"v\" d=\"m10 0v160 m 20 0 v-160\" class=\"g\"/> <use xlink:href=\"#v\" transform=\"translate(40,0)\"/></g> <use xlink:href=\"#v2\" transform=\"translate(80,0)\"/></g> <use xlink:href=\"#v4\" transform=\"translate(160,0)\"/></g> <use xlink:href=\"#v8\" transform=\"translate(320,0)\"/></g> <path id=\"b\" d=\"m0 0h80v60h-80z\" class=\"s\"/> </del> <ins> <defs> <g id=\"diagram-m\"> <g id=\"diagram-h4\"> <g id=\"diagram-h2\"> <path id=\"diagram-h\" d=\"m0 10h 640\" class=\"diagram-g\"/> <use xlink:href=\"#diagram-h\" transform=\"translate(0, 20)\"/> </g> <use xlink:href=\"#diagram-h2\" transform=\"translate(0, 40)\"/> </g> <use xlink:href=\"#diagram-h4\" transform=\"translate(0, 80)\"/> <g id=\"diagram-v8\"> <g id=\"diagram-v4\"> <g id=\"diagram-v2\"> <path id=\"diagram-v\" d=\"m10 0v160 m 20 0 v-160\" class=\"diagram-g\"/> <use xlink:href=\"#diagram-v\" transform=\"translate(40, 0)\"/> </g> <use xlink:href=\"#diagram-v2\" transform=\"translate(80, 0)\"/> </g> <use xlink:href=\"#diagram-v4\" transform=\"translate(160, 0)\"/> </g> <use xlink:href=\"#diagram-v8\" transform=\"translate(320, 0)\"/> </g> <path id=\"diagram-b\" d=\"m0 0h80v60h-80z\" class=\"diagram-s\"/> </ins> </defs> <del> <g transform=\"translate(.5,.5)\"> <use xlink:href=\"#m\"/> <g transform=\"translate(10,10)\"> <path d=\"m0 0v40h40v-40z\" class=\"s2\"/><path d=\"m20 0v40\" class=\"d\"/> <path d=\"m60 0v40h40v-40z\" class=\"s2\"/><path d=\"m60 20h40\" class=\"d\"/> <g transform=\"translate(120, 0)\"> <use xlink:href=\"#b\"/><path d=\"m0 20h40v20h40\" class=\"d\"/></g> <g transform=\"translate(220, 0)\"> <use xlink:href=\"#b\"/><path d=\"m0 40h40v-20h40\" class=\"d\"/></g> <g transform=\"translate(320, 0)\"> <use xlink:href=\"#b\"/><path d=\"m20 0v40h20v-20h20v40\" class=\"d\"/></g> <g transform=\"translate(420, 0)\"> <use xlink:href=\"#b\"/><path d=\"m60 0v40h-20v-20h-20v40\" class=\"d\"/></g> <g transform=\"translate(20, 80)\"> <use xlink:href=\"#b\"/><path d=\"m40 0v60\" class=\"d\"/></g> <g transform=\"translate(120, 80)\"> <use xlink:href=\"#b\"/><path d=\"m60 0v20h-20v20h-20v20\" class=\"d\"/></g> <g transform=\"translate(220, 80)\"> <use xlink:href=\"#b\"/><path d=\"m20 0v20h20v20h20v20\" class=\"d\"/></g> <g transform=\"translate(320, 80)\"> <use xlink:href=\"#b\"/><path d=\"m0 20h20v20h20v-20h20v20h20\" class=\"d\"/></g> <g transform=\"translate(420, 80)\"> <use xlink:href=\"#b\"/><path d=\"m0 40h20v-20h20v20h20v-20h20\" class=\"d\"/></g> </g></g> </svg> </div> </del> <ins> <g transform=\"translate(.5, .5)\"> <use xlink:href=\"#diagram-m\"/> <g transform=\"translate(10, 10)\"> <path d=\"m0 0v40h40v-40z\" class=\"diagram-s2\"/> <path d=\"m20 0v40\" class=\"diagram-d\"/> <path d=\"m60 0v40h40v-40z\" class=\"diagram-s2\"/> <path d=\"m60 20h40\" class=\"diagram-d\"/> <g transform=\"translate(120, 0)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m0 20h40v20h40\" class=\"diagram-d\"/> </g> <g transform=\"translate(220, 0)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m0 40h40v-20h40\" class=\"diagram-d\"/> </g> <g transform=\"translate(320, 0)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m20 0v40h20v-20h20v40\" class=\"diagram-d\"/> </g> <g transform=\"translate(420, 0)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m60 0v40h-20v-20h-20v40\" class=\"diagram-d\"/> </g> <g transform=\"translate(20, 80)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m40 0v60\" class=\"diagram-d\"/> </g> <g transform=\"translate(120, 80)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m60 0v20h-20v20h-20v20\" class=\"diagram-d\"/> </g> <g transform=\"translate(220, 80)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m20 0v20h20v20h20v20\" class=\"diagram-d\"/> </g> <g transform=\"translate(320, 80)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m0 20h20v20h20v-20h20v20h20\" class=\"diagram-d\"/> </g> <g transform=\"translate(420, 80)\"> <use xlink:href=\"#diagram-b\"/> <path d=\"m0 40h20v-20h20v20h20v-20h20\" class=\"diagram-d\"/> </g> </g> </g> </svg> </div> </ins> # --instructions--"} | |
| {"_id":"q-en-freeCodeCamp-cfad913f5a252a93a0ebead4382986a11846404c5fab67af548bf667b43ce998","text":"assert.exists(title); ``` <del> The `title` element should be within the `head` element. </del> <ins> Your `title` element should be within the `head` element. </ins> ```js assert.exists(document.querySelector('head > title')); ``` <del> Your project should have a title of `Registration Form`. </del> <ins> Your project should have a title of `Registration Form`. Remember, the casing and spelling matters for the title. </ins> ```js const title = document.querySelector('title'); <del> assert.equal(title.text.toLowerCase(), 'registration form') </del> <ins> assert.equal(title.text, 'Registration Form'); </ins> ``` <del> Remember, the casing and spelling matters for the title. </del> <ins> You should create a `meta` element within the `head` element. </ins> ```js <del> const title = document.querySelector('title'); assert.equal(title.text, 'Registration Form'); </del> <ins> assert.exists(document.querySelector('head > meta')); ``` You should give the `meta` element a `charset` attribute with the value of `utf-8`. ```js assert.equal(document.querySelector('head > meta')?.getAttribute('charset')?.toLowerCase(), 'utf-8'); ``` Your `meta` element should be a void element, it does not have an end tag `</meta>`. ```js assert.notMatch(code, /</metas*>?/i); </ins> ``` # --seed--"} | |
| {"_id":"q-en-freeCodeCamp-cff4b3531ea755cde5d7edd336795ed4235e9213ffa170cd165544641c22d97c","text":"id: 587d778d367417b2b2512aaa title: Make Elements Only Visible to a Screen Reader by Using Custom CSS challengeType: 0 <del> videoUrl: 'https://scrimba.com/c/c8azdfM' </del> <ins> videoUrl: 'https://scrimba.com/c/cJ8QGkhJ' </ins> --- ## Description"} | |
| {"_id":"q-en-freeCodeCamp-d09bcb171c007272320e6e5fb0c091d34f280dac05ef90a53b08091304a5015f","text":"\"Aside from using open source libraries such as jQuery and Bootstrap, and short snippets of code which are clearly attributed to their original author, 100% of the code in my projects was written by me, or <del> along with another camper with whom I was pair programming in real time.\" </del> <ins> along with another person going through the freeCodeCamp curriculum with whom I was pair programming in real time.\" </ins> </p> <p key={5}> \"I pledge that I did not plagiarize any of my freeCodeCamp.org work. I"} | |
| {"_id":"q-en-freeCodeCamp-d187dca0878bafa11219167399cafff29b361df7c344b4a84f56fdf2b13bc3b1","text":"], \"MDNlinks\": [ \"Comparison Operators\", <del> \"String.slice()\", </del> <ins> \"Array.slice()\", </ins> \"Array.filter()\", \"Array.indexOf()\", <del> \"String.concat()\" </del> <ins> \"Array.concat()\" </ins> ], \"type\": \"bonfire\", \"challengeType\": 5,"} | |
| {"_id":"q-en-freeCodeCamp-d20266f7abbf07fae19c03b9e7b710be2a2ecc1286ec769bb8b40c83a67935df","text":"The `<header>` tag is a container which is used for navigational links or introductory content. It may typically include heading elements, such as `<h1>`, `<h2>`, but may also include other elements such as a search form, logo, author information etc. <del> <h1> corresponds to the most important heading. As we move to other tags like <h2>, <h3>, etc the degree of importance decreases. </del> <ins> `<h1>` corresponds to the most important heading. As we move to other tags like `<h2>`, `<h3>`, etc the degree of importance decreases. </ins> Although not required, the `<header>` tag is intended to contain the surrounding sections heading. It may also be used more than once in an HTML document. It is important to note that the `<header>` tag does not introduce a new section, but is simply the head of a section. Here's an example using the `<header>` tag:"} | |
| {"_id":"q-en-freeCodeCamp-d3dfd43fb25ed0e79bc19edd1c9ccb3480958598c116986fb0edf3045c383c15","text":"\"<p>Hello Paragraph</p>\" ], \"tests\": [ <del> \"assert.isTrue((/Kitty(s)+ipsum(s)+dolor/gi).test($(\"p\").text()), 'message: Your <code>p</code> element should contain the first few words of the provided <code>kitty ipsum text</code>.');\" </del> <ins> \"assert.isTrue((/Kitty(s)+ipsum/gi).test($(\"p\").text()), 'message: Your <code>p</code> element should contain the first few words of the provided <code>kitty ipsum text</code>.');\" </ins> ], \"challengeType\": 0, \"nameEs\": \"Llena espacios con texto de relleno\","} | |
| {"_id":"q-en-freeCodeCamp-d4bb4f092032cdf50d762b6b0cdfc69373e976ea0b572dcc4ccd8af9c729b520","text":"const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, <del> body: `username=fcc_test_${Date.now()}`.substingr(0, 29) </del> <ins> body: `username=fcc_test_${Date.now()}`.substring(0, 29) </ins> }); if (res.ok) { const { _id, username } = await res.json();"} | |
| {"_id":"q-en-freeCodeCamp-d4edd648275c7a525695055ff2e201dddfcfb23f8eec699f8e4a26ff0c09b05d","text":"\"In the game of <a href=\"https://en.wikipedia.org/wiki/Golf\" target=\"_blank\">golf</a> each hole has a <code>par</code> meaning the average number of <code>strokes</code> a golfer is expected to make in order to sink the ball in a hole to complete the play. Depending on how far above or below <code>par</code> your <code>strokes</code> are, there is a different nickname.\", \"Your function will be passed <code>par</code> and <code>strokes</code> arguments. Return the correct string according to this table which lists the strokes in order of priority; top (highest) to bottom (lowest):\", \"<table class=\"table table-striped\"><thead><tr><th>Strokes</th><th>Return</th></tr></thead><tbody><tr><td>1</td><td>\"Hole-in-one!\"</td></tr><tr><td><= par - 2</td><td>\"Eagle\"</td></tr><tr><td>par - 1</td><td>\"Birdie\"</td></tr><tr><td>par</td><td>\"Par\"</td></tr><tr><td>par + 1</td><td>\"Bogey\"</td></tr><tr><td>par + 2</td><td>\"Double Bogey\"</td></tr><tr><td>>= par + 3</td><td>\"Go Home!\"</td></tr></tbody></table>\", <del> \"<code>par</code> and <code>strokes</code> will always be numeric and positive.\" </del> <ins> \"<code>par</code> and <code>strokes</code> will always be numeric and positive. We have added an array of all the names for your convenience.\" </ins> ], \"releasedOn\": \"January 1, 2016\", \"challengeSeed\": [ <ins> \"var names = [\"Hole-in-one!\", \"Eagle\", \"Birdie\", \"Par\", \"Bogey\", \"Double Bogey\", \"Go Home!\"];\", </ins> \"function golfScore(par, strokes) {\", \" // Only change code below this line\", \" \","} | |
| {"_id":"q-en-freeCodeCamp-d51878266dfda2768f4c741e7759a3066bbab70a947a4862542136e0f1d7eb21","text":"--fcc-editable-region-- function pick(guess) { <del> let numbers = []; </del> <ins> const numbers = []; </ins> } --fcc-editable-region--"} | |
| {"_id":"q-en-freeCodeCamp-d6112fcf56d6c2a623fcb0114992497673d1ed97b1390009d1cfdea7fc50f2d4","text":"- text: Clicking the decrement button should decrement the count by <code>1</code>. testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(Counter)); const first = () => { mockedComponent.setState({ count: 0 }); return waitForIt(() => mockedComponent.state(''count'')); }; const second = () => { mockedComponent.find(''.dec'').simulate(''click''); return waitForIt(() => mockedComponent.state(''count'')); }; const firstValue = await first(); const secondValue = await second(); assert(firstValue === 0 && secondValue === -1, ''Clicking the decrement button should decrement the count by <code>1</code>.''); }; ' - text: Clicking the reset button should reset the count to <code>0</code>. <del> testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(Counter)); const init = () => { mockedComponent.setState({ count: 0 }); return waitForIt(() => mockedComponent.state(''count'')); }; const increment = () => { mockedComponent.find(''.inc'').simulate(''click''); mockedComponent.find(''.inc'').simulate(''click''); return waitForIt(() => mockedComponent.state(''count'')); }; const decrement = () => { mockedComponent.find(''.dec'').simulate(''click''); return waitForIt(() => mockedComponent.state(''count'')); }; const reset = () => { mockedComponent.find(''.reset'').simulate(''click''); return waitForIt(() => mockedComponent.state(''count'')); }; const firstValue = await init(); const secondValue = await increment(); const thirdValue = await decrement(); const fourthValue = await reset(); assert(firstValue === 0 && secondValue === 2 && thirdValue === 1 && fourthValue === 0, ''Clicking the reset button should reset the count to <code>0</code>.''); }; ' </del> <ins> testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(Counter)); const init = () => { mockedComponent.setState({ count: 0 }); return waitForIt(() => mockedComponent.state(''count'')); }; const increment = () => { mockedComponent.find(''.inc'').simulate(''click''); mockedComponent.find(''.inc'').simulate(''click''); mockedComponent.find(''.inc'').simulate(''click''); return waitForIt(() => mockedComponent.state(''count'')); }; const decrement = () => { mockedComponent.find(''.dec'').simulate(''click''); return waitForIt(() => mockedComponent.state(''count'')); }; const reset = () => { mockedComponent.find(''.reset'').simulate(''click''); return waitForIt(() => mockedComponent.state(''count'')); }; const firstValue = await init(); const secondValue = await increment(); const thirdValue = await decrement(); const fourthValue = await reset(); assert(firstValue === 0 && secondValue === 3 && thirdValue === 2 && fourthValue === 0, ''Clicking the reset button should reset the count to <code>0</code>.''); }; ' </ins> ```"} | |
| {"_id":"q-en-freeCodeCamp-d717b063282dbe85247156870cc8ce3e40c6f7776c21eaf2eae6500d4f231c13","text":"return ( <button className={classes} onClick={onClick} type='button'> <del> <span className='sr-only'>{label ?? 'Close'}</span> </del> <ins> <span className='sr-only'>{label || 'Close'}</span> </ins> <span aria-hidden>×</span> </button> );"} | |
| {"_id":"q-en-freeCodeCamp-d73f0d96478b4acc751e0037996a851f5f510f1018bfcda8c91ba2ef430e73fd","text":"Your `letters.forEach()` callback function should be nested inside the `range(1, 99).forEach(number => {}` callback function. ```js <del> assert.match(code, /ranges*(s*1s*,s*99s*)s*.forEachs*(s*((s*numbers*)|number)s*=>s*{s*[^}]*letters.forEach(s*((s*letters*)|letter)s*=>s*{s*}s*)s*}s*)/) </del> <ins> assert.match(code, /ranges*(s*1s*,s*99s*)s*.forEachs*(s*((s*numbers*)|number)s*=>s*{s*[^}]*letters.forEach(s*((s*letters*)|letter)s*=>s*{s*}s*)s*;?s*}s*)/) </ins> ``` # --seed--"} | |
| {"_id":"q-en-freeCodeCamp-db1c9df9c0c337f7d48756e79b0be9c9322ce40d1a00cf386b87896d5a87b472","text":"); ``` <ins> Trying to remove an element from an empty tree should return `null`. ```js assert( (function () { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree(); } else { return false; } if (typeof test.remove !== 'function') { return false; } return test.remove(100) == null; })() ); ``` </ins> Trying to remove an element that does not exist should return `null`. ```js"} | |
| {"_id":"q-en-freeCodeCamp-db368fbd1011e65e2ed6a2b9e6b67d6b82a55ebb75d9e19e45aa20d0e7d3372f","text":"} from '../../../redux/selectors'; import { ChallengeFiles, <del> ChallengeTest, </del> Dimensions, FileKey, ResizeProps,"} | |
| {"_id":"q-en-freeCodeCamp-dc6ad898471f2ead0d7f3fe14a9bde386e5cab0e714298aeaf4ba1d46114eebb","text":"} return { <del> postResult </del> <ins> postResult, oldLog </ins> }; })();"} | |
| {"_id":"q-en-freeCodeCamp-e05c4b4fcdc6aa35b9e15ee1f1026d3882cf15eeb028501af76043b79c4b7a47","text":"isResetting: boolean, isSignedIn: boolean, { theme }: { theme: Themes }, <del> tests: [{ text: string; testString: string }], </del> <ins> tests: [{ text: string; testString: string; message?: string }], </ins> isChallengeCompleted: boolean ) => ({ attempts,"} | |
| {"_id":"q-en-freeCodeCamp-e3d1258418d7ca30a562b15bdd5c10f92cc73e52168344059a527169866535f7","text":"\"He aquí un ejemplo:\", \"<code><p>Aquí está un <a href=\"https://freecodecamp.org\"> enlace a freeCodeCamp</a> para que lo sigas.</p></code>\", \"<hr>\", <del> \"Crea un elemento <code>a</code> que se vincule a <code>http://freecatphotoapp.com</code> y tenga como <code>texto de ancla</code> \"fotos de gatos\".\" </del> <ins> \"Crea un elemento <code>a</code> que se vincule a <code>http://freecatphotoapp.com</code> y tenga como <code>texto de ancla</code> \"cat photos\".\" </ins> ] }, \"pt-br\": {"} | |
| {"_id":"q-en-freeCodeCamp-e40eee4f0b504afabe97893452f534ddc5c7f9704595ddf541cff4465226282a","text":"--- # --description-- <del> The `em` element makes text italic. It also semantically places emphasis on the text, which again may affect things like screen readers. To define an emphasized element you wrap text content in a `<em>` tag. </del> <ins> The `em` element makes text italic. It also semantically places emphasis on the text, which again may affect things like screen readers. To define an emphasized element you wrap text content in an `<em>` tag. </ins> To use `em` on its own: <iframe allowfullscreen=\"true\" allowpaymentrequest=\"true\" allowtransparency=\"true\" class=\"cp_embed_iframe \" frameborder=\"0\" height=\"300\" width=\"100%\" name=\"cp_embed_6\" scrolling=\"no\" src=\"https://codepen.io/TheOdinProjectExamples/embed/wvewqpp?height=300&theme-id=dark&default-tab=html%2Cresult&slug-hash=wvewqpp&user=TheOdinProjectExamples&name=cp_embed_6\" style=\"width: 100%; overflow:hidden; display:block;\" title=\"CodePen Embed\" loading=\"lazy\" id=\"cp_embed_wvewqpp\"></iframe>"} | |
| {"_id":"q-en-freeCodeCamp-e6509666bf197d45f14e9e996007f43e72770e6da56fa12e682e4fde437c4b4e","text":"const keyMap = { NAVIGATION_MODE: 'escape', EXECUTE_CHALLENGE: ['ctrl+enter', 'command+enter'], <ins> FOCUS_EDITOR: 'e', </ins> NAVIGATE_PREV: ['p'], NAVIGATE_NEXT: ['n'] };"} | |
| {"_id":"q-en-freeCodeCamp-e879febdc916dc6774cf05e3513438ce015af1a93acd30af002eb2fbda622309","text":"assert.match(code, /consts+collisionDetectionRuless*=s*[s*(?:[^]]*s*)*];?/); ``` <del> You should have a conditional statement that checks if the player's `y` position plus the player's height is less than or equal to the platform's `y` position. </del> <ins> You should have a boolean expression that checks if the player's `y` position plus the player's height is less than or equal to the platform's `y` position. </ins> ```js assert.match(code, /consts+collisionDetectionRuless*=s*[s*player.position.ys++s*player.heights*<=s*platform.position.y,?s*]s*;?/);"} | |
| {"_id":"q-en-freeCodeCamp-e8b48ad34ea805bb531ad982ad828ac2558c4da486a357ec5e3670f07775f18d","text":"} return test; } <del> // tail: let rules=[[\"A -> apple\",\"B -> bag\",\"S -> shop\",\"T -> the\",\"the shop -> my brother\",\"a never used -> .terminating rule\"], [\"A -> apple\",\"B -> bag\",\"S -> .shop\",\"T -> the\",\"the shop -> my brother\",\"a never used -> .terminating rule\"], [\"A -> apple\",\"WWWW -> with\",\"Bgage -> ->.*\",\"B -> bag\",\"->.* -> money\",\"W -> WW\",\"S -> .shop\",\"T -> the\",\"the shop -> my brother\",\"a never used -> .terminating rule\"], [\"_+1 -> _1+\",\"1+1 -> 11+\",\"1! -> !1\",\",! -> !+\",\"_! -> _\",\"1*1 -> x,@y\",\"1x -> xX\",\"X, -> 1,1\",\"X1 -> 1X\",\"_x -> _X\",\",x -> ,X\",\"y1 -> 1y\",\"y_ -> _\",\"1@1 -> x,@y\",\"1@_ -> @_\",\",@_ -> !_\",\"++ -> +\",\"_1 -> 1\",\"1+_ -> 1\",\"_+_ -> \"], [\"A0 -> 1B\",\"0A1 -> C01\",\"1A1 -> C11\",\"0B0 -> A01\",\"1B0 -> A11\",\"B1 -> 1B\",\"0C0 -> B01\",\"1C0 -> B11\",\"0C1 -> H01\",\"1C1 -> H11\"]]; let tests=[\"I bought a B of As from T S.\", \"I bought a B of As from T S.\", \"I bought a B of As W my Bgage from T S.\", \"_1111*11111_\", \"000000A000000\"]; let outputs=[\"I bought a bag of apples from my brother.\", \"I bought a bag of apples from T shop.\", \"I bought a bag of apples with my money from T shop.\", \"11111111111111111111\", \"00011H1111000\"]; </del> ```"} | |
| {"_id":"q-en-freeCodeCamp-e9196c09d5cb847522d97e9607516d222db6710072c7ed2ff38c58b6c5e4055e","text":"); ``` <del> `newestBookList` should equal `[\"The Hound of the Baskervilles\", \"Philosophiæ Naturalis Principia Mathematica\", \"Disquisitiones Arithmeticae\", \"A Brief History of Time\"]`. </del> <ins> `remove(add(bookList, \"A Brief History of Time\"), \"On The Electrodynamics of Moving Bodies\");` should equal `[\"The Hound of the Baskervilles\", \"Philosophiæ Naturalis Principia Mathematica\", \"Disquisitiones Arithmeticae\", \"A Brief History of Time\"]`. </ins> ```js assert( <del> JSON.stringify(newestBookList) === </del> <ins> JSON.stringify(remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies')) === </ins> JSON.stringify([ 'The Hound of the Baskervilles', 'Philosophiæ Naturalis Principia Mathematica',"} | |
| {"_id":"q-en-freeCodeCamp-e9ae86693e537085f6ea767608db9510676c29be39db7b885c9dcf2a3f3da7c2","text":"], \"description\": [ \"You can add the <code>fa-paper-plane</code> Font Awesome icon by adding <code><i class=\"fa fa-paper-plane\"></i></code> within your submit <code>button</code> element.\", <del> \"Give your form's text input field a class of <code>form-control</code>. Give your form's submit button the classes <code>btn btn-primary</code>. Also give this button the Font Awesome icon of <code>fa-paper-plane</code>.\" </del> <ins> \"Give your form's text input field a class of <code>form-control</code>. Give your form's submit button the classes <code>btn btn-primary</code>. Also give this button the Font Awesome icon of <code>fa-paper-plane</code>.\", \"All textual <code><input></code>, <code><textarea></code>, and <code><select></code> elements with the class <code>.form-control</code> have a width of 100%.\" </ins> ], \"challengeSeed\": [ \"<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">\","} | |
| {"_id":"q-en-freeCodeCamp-ea055b63335f8e2eab5375fd3a10ccde66d3a41e124f4a99e8e088cd27c62429","text":"} } <del> @media (max-width: 767px) { .certificate-outer-wrapper .donation-section { padding: 20px 20px; } } </del> @media screen and (max-width: 992px) { .certification-namespace header { height: 160px;"} | |
| {"_id":"q-en-freeCodeCamp-ea3930f8351595c69b620dc544140e6d77d97e8a2b12301bd6e6be6816352e0b","text":"- text: All elements from the first array should be added to the second array in their original order. testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]); - text: The first array should remain the same after the function runs. <del> testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr1, [1, 2]); </del> <ins> testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr1, [1, 2]); </ins> - text: The second array should remain the same after the function runs. <del> testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr2, [\"a\", \"b\"]); </del> <ins> testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr2, [\"a\", \"b\"]); </ins> ```"} | |
| {"_id":"q-en-freeCodeCamp-ea6c1ef79edae71498aa3a7a3173126d12499973580ec22131d66c4dbe79a1fb","text":"import DonateModal from '../Donation'; import 'prismjs/themes/prism.css'; <ins> import './prism.css'; import './prism-night.css'; </ins> import 'react-reflex/styles.css'; import './learn.css';"} | |
| {"_id":"q-en-freeCodeCamp-eb26c80256ce7dec136630e7e4525175769da86676bd0dd02edc865eb3dfa0e7","text":"); ``` <del> `newerBookList` should equal `[\"The Hound of the Baskervilles\", \"Philosophiæ Naturalis Principia Mathematica\", \"Disquisitiones Arithmeticae\"]`. </del> <ins> `remove(bookList, \"On The Electrodynamics of Moving Bodies\")` should return `[\"The Hound of the Baskervilles\", \"Philosophiæ Naturalis Principia Mathematica\", \"Disquisitiones Arithmeticae\"]`. </ins> ```js assert( <del> JSON.stringify(newerBookList) === </del> <ins> JSON.stringify(remove(bookList, 'On The Electrodynamics of Moving Bodies')) === </ins> JSON.stringify([ 'The Hound of the Baskervilles', 'Philosophiæ Naturalis Principia Mathematica',"} | |
| {"_id":"q-en-freeCodeCamp-eb6758ace99fe0ced3233a6cd67268abeeea2bb1b2ffa288dff7e99f3e137ac2","text":"} .certification-namespace .information { <del> margin-top: -20px; </del> height: 380px; text-align: center; background-color: var(--gray-05);"} | |
| {"_id":"q-en-freeCodeCamp-ebd4c83ff4c1e3aeb0fc0300ea644408ae250d99fba8ff6bbaaa84aaabefc7f3","text":"You should use a `for...of` loop to iterate through the `arr` array. ```js <del> assert.match(code, /consts+detectFullHouses*=s*((s*arrs*)|arr)s*=>s*{.*s*fors*(s*consts+nums+ofs+arrs*)s*{s*.*}/s); </del> <ins> assert.match(code, /consts+detectFullHouses*=s*((s*arrs*)|arr)s*=>s*{.*s*fors*(s*(const|let|var)s+nums+ofs+arrs*)s*{s*.*}/s); </ins> ``` # --seed--"} | |
| {"_id":"q-en-freeCodeCamp-ec437e69e4d85797ebee8646d53383ad8887003e7e6d542bf9773750d6f74cc3","text":"); ``` <del> `newBookList` should equal `[\"The Hound of the Baskervilles\", \"On The Electrodynamics of Moving Bodies\", \"Philosophiæ Naturalis Principia Mathematica\", \"Disquisitiones Arithmeticae\", \"A Brief History of Time\"]`. </del> <ins> `add(bookList, \"A Brief History of Time\")` should return `[\"The Hound of the Baskervilles\", \"On The Electrodynamics of Moving Bodies\", \"Philosophiæ Naturalis Principia Mathematica\", \"Disquisitiones Arithmeticae\", \"A Brief History of Time\"]`. </ins> ```js assert( <del> JSON.stringify(newBookList) === </del> <ins> JSON.stringify(add(bookList, \"A Brief History of Time\")) === </ins> JSON.stringify([ 'The Hound of the Baskervilles', 'On The Electrodynamics of Moving Bodies',"} | |
| {"_id":"q-en-freeCodeCamp-ed10a33452af196ceca5f25d187dcb2a90e2a9d7d602810e4266c10b4eefc2f2","text":"const getMultiple = await $.get(url + '?created_by=Alice&assigned_to=Bob'); assert.isArray(getMultiple); assert.lengthOf(getMultiple, 2); <ins> const copyId = getMultiple[0]._id; const getById = await $.get(url + `?_id=${copyId}`); assert.isArray(getById); assert.lengthOf(getById, 1); assert.equal(getById[0]._id, copyId, 'should be able to query a document by _id') </ins> } catch (err) { throw new Error(err.responseText || err.message); }"} | |
| {"_id":"q-en-freeCodeCamp-ee947bcf01e78cf8f2644faae49d5c81f77b05324d2f50e1bf9076dc294a7324","text":"req.flash('info', { msg: dedent` Once you have completed all of our challenges, you should <del> join our <a href=\"//gitter.im/freecodecamp/HalfWayClub\" target=\"_blank\">Half Way Club</a> and start getting </del> <ins> join our <a href=\"https://gitter.im/freecodecamp/HalfWayClub\" target=\"_blank\">Half Way Club</a> and start getting </ins> ready for our nonprofit projects. `.split('n').join(' ') });"} | |
| {"_id":"q-en-freeCodeCamp-ef3cd4a426d3a7c8a76bbf21b64f9703cfecafc217b2ece019643c12873805b1","text":"Your `h2` tag should have a `width` of 80vw. ```js <del> assert(code.match(/h2s*?{s*?width:s*?80vw;s*?}/g)); </del> <ins> assert( __helpers .removeCssComments(code) .match(/h2s*?{s*?width:s*?80vw;s*?}/g) ); </ins> ``` Your `p` tag should have a `width` of 75vmin. ```js <del> assert(code.match(/ps*?{s*?width:s*?75vmin;s*?}/g)); </del> <ins> assert( __helpers .removeCssComments(code) .match(/ps*?{s*?width:s*?75vmin;s*?}/g) ); </ins> ``` # --seed--"} | |
| {"_id":"q-en-freeCodeCamp-f099c8f2a1929360775ba86f7939f27b78086dfd0320ee6239d8d8bdf0750f13","text":"e.preventDefault(); if (executeChallenge) executeChallenge(); }, <ins> FOCUS_EDITOR: e => { e.preventDefault(); if (editorRef && editorRef.current) { editorRef.current.getWrappedInstance().focusOnEditor(); } }, </ins> NAVIGATION_MODE: () => setEditorFocusability(false), NAVIGATE_PREV: () => { if (!canFocusEditor) navigate(prevChallengePath);"} | |
| {"_id":"q-en-freeCodeCamp-f0a3bf71d9fe0cf8c94df9a9b7be0c13cbceb6a477a3130de50bc651a875733e","text":"id: bad87fee1348bd9aede08817 title: Nest an Anchor Element within a Paragraph challengeType: 0 <del> videoUrl: 'https://scrimba.com/p/pVMPUv/cb6k8Cb' </del> forumTopicId: 18244 dashedName: nest-an-anchor-element-within-a-paragraph ---"} | |
| {"_id":"q-en-freeCodeCamp-f145d9add067bef98909f1fc53dd84b45858c1cd760bf627ccbb6174a5c861d5","text":"The `console.log(array[0])` prints `50`, and `data` has the value `60`. <del> **Note:** There shouldn't be any spaces between the array name and the square brackets, like `array [0]`. Although JavaScript is able to process this correctly, this may confuse other programmers reading your code. </del> # --instructions-- Create a variable called `myData` and set it to equal the first value of `myArray` using bracket notation."} | |
| {"_id":"q-en-freeCodeCamp-f41458f481a3465c0cfd78379b1c90476d6c4c004d28c2400c8e8454477f6a2e","text":"```yml tests: <del> - text: <code>resolve</code> should be executed when the <code>if</code> condition is <code>true</code>. </del> <ins> - text: <code>resolve</code> should be called with the expected string when the <code>if</code> condition is <code>true</code>. </ins> testString: assert(removeJSComments(code).match(/ifs*(s*responseFromServers*)s*{s*resolves*(s*('|\"|`)We got the data1s*)(s*|s*;s*)}/g)); <del> - text: <code>reject</code> should be executed when the <code>if</code> condition is <code>false</code>. </del> <ins> - text: <code>reject</code> should be called with the expected string when the <code>if</code> condition is <code>false</code>. </ins> testString: assert(removeJSComments(code).match(/}s*elses*{s*rejects*(s*('|\"|`)Data not received1s*)(s*|s*;s*)}/g)); ```"} | |
| {"_id":"q-en-freeCodeCamp-f678d913a9c384b61db3b7855ce4bdcebf5ce5ed24a956fee9e3cc649c8333ae","text":"Moving on to the final `fieldset`. What if you wanted to allow a user to upload a profile picture? <del> Well, the `input` type `file` allows just that. Add a `label` with the text `Upload a profile picture: `, and add an `input` accepting a file upload. </del> <ins> Well, the `input` type `file` allows just that. Add a `label` with the text `Upload a profile picture: `, and nest an `input` accepting a file upload. </ins> # --hints--"} | |
| {"_id":"q-en-freeCodeCamp-f91cb96a087728d5b4bffee4a3bc23f6899eae494e4ed3658ebb04bda159c42a","text":"<ins> --- title: Static Site Generators --- ## Static web page Static web pages are often HTML documents stored as files in the file system and made available by the web server over HTTP (nevertheless URLs ending with \".html\" are not always static). However, loose interpretations of the term could include web pages stored in a database, and could even include pages formatted using a template and served through an application server, as long as the page served is unchanging and presented essentially as stored. Static web pages are suitable for the contents that never or rarely need to be updated, though modern static site generators are changing. Maintaining large numbers of static pages as files can be impractical without automated tools, such as Static site generators described in the Web template system. Another way to manage static pages include Online compiled source code playgrounds, e.g. GatsbyJS and GitHub may be utilized for migrating a WordPress site into static web pages. Any personalization or interactivity has to run client-side, which is restricting. ## Static Site Generators A Static Site Generator is a program, that generates an HTML website as an output. This HTML website is then served through your web server, just like the olden days. This is usually achieved using template languages and code that separates out the layout of the website from its content and styles. ## How static sites work The proposition of a static site is to shift the heavy load from the moment visitors request the content to the moment content actually changes. Going back to our news kiosk metaphor, think of a scenario where it's the news agencies who call the kiosk whenever something newsworthy happens. The kiosk operators and scribbles will then compile, format and style the stories and produce a finished newspaper right away, even though nobody ordered one yet. They will print out a huge number of copies (infinite, actually) and pile them up by the storefront. When customers arrive, there's no need to wait for an operator to become available, place the phone call, pass the results to the scribble and wait for the final product. The newspaper is already there, waiting in a pile, so the customer can be served instantly. And that is how static site generators work. They take the content, typically stored in flat files rather than databases, apply it against layouts or templates and generate a structure of purely static HTML files that are ready to be delivered to the users. ## Advantages of static 1) Speed Perhaps the most immediately noticeable characteristic of a static site is how fast it is. As mentioned above, there are no database queries to run, no templating and no processing whatsoever on every request. Web servers are really good at delivering static pages quickly, and the entire site consists of static HTML files that are sitting on the server, waiting to be served, so a request is served back to the user pretty much instantly. 2) Version control for content You can't even imagine working on a project without version control anymore, can you? Having a repository where people can collaboratively work on files, control exactly who does what and rollback changes when something goes wrong is essential in any software project, no matter how small. But what about the content? That's the keystone of any site and yet it usually sits in a database somewhere else, completely separated from the codebase and its version control system. In a static site, the content is typically stored in flat files and treated as any other component of the codebase. In a blog, for example, that means being able to have the actual posts stored in a GitHub repository and allowing your readers to file an issue when something is wrong or to add a correction with a pull request — how cool is that? 3) Security Platforms like WordPress are used by millions of people around the world, meaning they're common targets for hackers and malicious attacks — no way around it. Wherever there's user input/authentication or multiple processes running code on every request, there's a potential security hole to exploit. To be on top of the situation, site administrators need to keep patching their systems with security updates, constantly playing cat and mouse with attackers, a routine that may be overlooked by less experienced users. Static sites keep it simple since there's not much to mess up when there's only a web server serving plain HTML pages. 4) Less hassle with the server Installing and maintaining the infrastructure required to run a dynamic site can be quite challenging, especially when multiple servers are involved or when something needs to be migrated. There's packages, libraries, modules and frameworks with different versions and dependencies, there are different web servers and database engines in different operating systems. Sure, a static site generator is a software package with its dependencies as well, but that's only relevant at build time when the site is generated. Ultimately, the end result is a collection of HTML files that can be served anywhere, scaled and migrated as needed regardless of the server-side technologies. As for the site generation process, that can be done from an environment that you control locally and not necessarily on the web server that will run the site — heck, you can build an entire site on your laptop and push the result to the web when it's done. 5) Traffic surges Unexpected traffic peaks on a website can be a problem, especially when it relies intensively on database calls or heavy processing. Introducing caching layers such as Varnish or Memcached surely helps, but that ends up introducing more possible points of failure in the system. A static site is generally better prepared for those situations, as serving static HTML pages consumes a very small amount of server resources. ## Disadvantages of static (and potential solutions) 1) No real-time content With a static site, you lose the ability to have real-time data, such as indication about which stories have been trending for the past hour, or content that dynamically changes for each visitor, like a \"recommended articles for you\" kind of thing. Static is static and will be the same for everyone. There's not really a solution for this, I'm afraid. It's the ultimate price to pay for using a static site, so it's important that you ask yourself the question \"how real-time does my site need to be?\" — if its concept is based around delivering real-time information then perhaps a static site isn't the right choice. A dangerous solution: There's an easy exit for whenever you're faced with the challenge of dynamically updating content on a static site: \"I can do it with JavaScript\". Doing processing on the client-side and appending the results to the page after it's been served can be the right approach for some cases, but must not be seen as the magic solution that turns your static site into a fully dynamic one. It can prevent some users from seeing the injected content, hurt your SEO and introduce other problems, potentially taking away the ease of mind and sense of control that comes with using a static site. 2) No user input Adding user-generated content to a static site is a bit of a challenge. Take a commenting system for a blog, for example — how do you process user comments and append them to a post using just plain HTML pages? You don't. </ins>"} | |
| {"_id":"q-en-freeCodeCamp-fc2937b615feb9f987f664ab2b4c56d05a65fe972eff2b5071ad109a8c26fcef","text":"className=\"spacer\" style={ { <del> \"height\": \"1px\", </del> \"padding\": \"15px 0\", } }"} | |
| {"_id":"q-en-freeCodeCamp-fcc562902cc8fd9be52ca3c6467f6cccdf2c5b5ffc0cb94a1898511b0a02e310","text":"expect(redirectUrl.pathname).toBe('/authorize'); }); }); <ins> describe('GET /mobile-login', () => { let superGet: ReturnType<typeof createSuperRequest>; beforeAll(() => { superGet = createSuperRequest({ method: 'GET' }); }); beforeEach(async () => { await fastifyTestInstance.prisma.userRateLimit.deleteMany({}); await fastifyTestInstance.prisma.user.deleteMany({ where: { email: newUserEmail } }); }); it('should be rate-limited', async () => { await Promise.all( [...Array(10).keys()].map(() => superGet('/mobile-login')) ); const res = await superGet('/mobile-login'); expect(res.status).toBe(429); }); it('should return 401 if the authorization header is invalid', async () => { mockedFetch.mockResolvedValueOnce(mockAuth0NotOk()); const res = await superGet('/mobile-login').set( 'Authorization', 'Bearer invalid-token' ); expect(res.body).toStrictEqual({ type: 'danger', message: 'We could not log you in, please try again in a moment.' }); expect(res.status).toBe(401); }); it('should return 400 if the email is not valid', async () => { mockedFetch.mockResolvedValueOnce(mockAuth0InvalidEmail()); const res = await superGet('/mobile-login').set( 'Authorization', 'Bearer valid-token' ); expect(res.body).toStrictEqual({ type: 'danger', message: 'The email is incorrectly formatted' }); expect(res.status).toBe(400); }); it('should set the jwt_access_token cookie if the authorization header is valid', async () => { mockedFetch.mockResolvedValueOnce(mockAuth0ValidEmail()); const res = await superGet('/mobile-login').set( 'Authorization', 'Bearer valid-token' ); expect(res.status).toBe(200); expect(res.get('Set-Cookie')).toEqual( expect.arrayContaining([expect.stringMatching(/jwt_access_token=/)]) ); }); it('should create a user if they do not exist', async () => { mockedFetch.mockResolvedValueOnce(mockAuth0ValidEmail()); const existingUserCount = await fastifyTestInstance.prisma.user.count(); const res = await superGet('/mobile-login').set( 'Authorization', 'Bearer valid-token' ); const newUserCount = await fastifyTestInstance.prisma.user.count(); expect(existingUserCount).toBe(0); expect(newUserCount).toBe(1); expect(res.status).toBe(200); }); it('should redirect to returnTo if already logged in', async () => { mockedFetch.mockResolvedValueOnce(mockAuth0ValidEmail()); const firstRes = await superGet('/mobile-login').set( 'Authorization', 'Bearer valid-token' ); expect(firstRes.status).toBe(200); const res = await superRequest('/mobile-login', { method: 'GET', // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment setCookies: firstRes.get('Set-Cookie') }) .set('Authorization', 'Bearer does-not-matter') .set('Referer', 'https://www.freecodecamp.org/back-home'); expect(res.status).toBe(302); expect(res.headers.location).toBe( 'https://www.freecodecamp.org/back-home' ); }); }); </ins> });"} | |
| {"_id":"q-en-freeCodeCamp-fd8b249c2347d135fd2d3050e5c3aca0b6eef75e8affebff2173fe037a7e3a67","text":"# --description-- <del> **Objective:** Build an app that is functionally similar to this: <a href=\"https://codepen.io/freeCodeCamp/full/EZKqza\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://codepen.io/freeCodeCamp/full/EZKqza</a>. </del> <ins> **Objective:** Build an app that is functionally similar to this: <a href=\"https://choropleth-map.freecodecamp.rocks\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https://choropleth-map.freecodecamp.rocks</a>. </ins> 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."} | |
| {"_id":"q-en-freeCodeCamp-fd906c28872e89fc1e47aa71f80b0ee359a1d58a64c32d40138a87e0155ee4ab","text":"assert(document.querySelectorAll('table')?.[1]?.querySelector('tbody')?.querySelectorAll('tr')?.[3]?.querySelector('th')); ``` <ins> Your text `Total Liabilities` should not include period `.`. ```js assert(document.querySelectorAll('table')?.[1]?.querySelector('tbody')?.querySelectorAll('tr')?.[3]?.querySelector('th')?.innerText !== 'Total Liabilities.'); ``` </ins> Your `th` element should have the text `Total Liabilities`. ```js"} | |
| {"_id":"q-en-freeCodeCamp-fe5a60b1d83f6ff3e8929ce83848fb4af2fc0374a880a29b3987e7ffe5802900","text":"\"cert-map-estimates\": { \"certs\": \"Certification (300u00A0hours)\", \"coding-prep\": \"(Thousands of hours of challenges)\" <ins> }, \"editor-tabs\": { \"info\": \"Info\", \"code\": \"Code\", \"tests\": \"Tests\", \"preview\": \"Preview\" </ins> } }, \"donate\": {"} | |