diff --git "a/freeCodeCamp/i2c/test/corpus.jsonl" "b/freeCodeCamp/i2c/test/corpus.jsonl" new file mode 100644--- /dev/null +++ "b/freeCodeCamp/i2c/test/corpus.jsonl" @@ -0,0 +1,220 @@ +{"_id":"doc-en-freeCodeCamp-72ea9a3034962ed50bcfd2755c53236fa887bc4add12e036ab6f05b36c139871","title":"","text":"\"Add them as a new contact in Screen Hero, then click the monitor-looking button to attempt to share your screen with them.\", \"Once the Screen Hero session starts, your screen's margins will glow orange. You are now sharing your screen.\", \"Your pair will have their own cursor, and will be able to type text on his or her and keyboard.\", \"Now it's time to tackle our Bonfires.\", \"Go to http://freecodecamp.com/bonfires and start working through our Bonfire challenges.\", \"Now it's time to tackle our Bonfires. You can begin them by advancing to the next challenge.\", \"Once you you finish pair programming, end the session in Screen Hero session.\", \"Congratulations! You have completed your first pair programming session.\", \"Pair program as much as possible with different campers until you've completed all the Bonfire challenges. This is a big time investment, but the JavaScript practice you get will be well worth it!\","} +{"_id":"doc-en-freeCodeCamp-64c5f560d071975b5f61d34b43c4d8f01193d3bcec7358c79b73426b42918238","title":"","text":"\"tests\": [ \"assert($('ul').length > 0, 'You should have an ul element on your webpage.')\", \"assert($('ol').length > 0, 'You should have an ol element on your webpage.')\", \"assert($('li').length > 5, 'You should have three li elements on within your ul element.')\", \"assert($('li').length > 5, 'You should have three li elements on within your ol element.')\" \"assert($('li').length > 5, 'You should have three li elements within your ul element.')\", \"assert($('li').length > 5, 'You should have three li elements within your ol element.')\" ], \"challengeSeed\": [ \"\","} +{"_id":"doc-en-freeCodeCamp-11603ee4c0318a5ac05d88d9dec011663abb3067d59221619d0adf34e9b6c8ed","title":"","text":"\"For example, if you wanted to make a text input field required, you can just add the word \"required\" within your input element use: <input type='text' required>\" ], \"tests\": [ \"assert($('input').prop('required'), 'Your text field have the property of being required.')\", \"assert($('[placeholder]').length > 0, 'Your text field should have the placeholder text of \"cat photo URL\".')\" \"assert($('input').prop('required'), 'Your text field should have the property of being required.')\", \"assert(new RegExp('cat photo URL').test($('input').prop('placeholder')), 'Your text field should have the placeholder text of \"cat photo URL\".')\" ], \"challengeSeed\": [ \"\","} +{"_id":"doc-en-freeCodeCamp-15753a1264c6a35e1d4e757d2344583b1ce8349ab49e83bb17dd97f02812fc26","title":"","text":"\"Put the \"like\", \"Info\" and \"Delete\" buttons side-by-side by wrapping all three of them within one <div class=\"row\"> element, then each of them within a <div class=\"col-xs-4\"> element.\", \"Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div element.\", \"Here's a diagram of how Bootstrap's 12-column grid layout works:\", \"\", \"\", \"Note that in this illustration, we use the col-md-* class. Here, \"md\" means \"medium\", and \"*\" is a number specifying how many columns wide the element should be. In this case, we're specifying how many columns wide an element should be on a medium-sized screen, such as a laptop.\", \"In the Cat Photo App that we're building, we'll use col-xs-*, where \"*\" is the number of columns wide the element should be, and \"xs\" means \"extra small\", like an extra-small mobile phone screen.\", \"The row class is applied to a div, and the buttons themselves can be wrapped within it.\""} +{"_id":"doc-en-freeCodeCamp-4aa2a01a6b29ba591967452055dd2bce22967259ecaf09e557ea3f198cd01986","title":"","text":"\"name\": \"Waypoint: Line up Form Elements Responsively with Bootstrap\", \"difficulty\" : 0.062, \"description\": [ \"Wrap both your form's text input field and submit button within a div with the class \"row\". Wrap your form's text input field within a div with the class of \"col-xs-7\". Wrap your form's submit button the in a div with the class \"col-xs-5\".\", \"Now let's get your form input and your submission button on the same line. We'll do this the same way we have previously: by using a \"row\" element with \"col-xs-*\" elements withing it.\", \"Wrap both your form's text input field and submit button within a div with the class \"row\". Wrap your form's text input field within a div with the class of \"col-xs-7\". Wrap your form's submit button the in a div with the class \"col-xs-5\".\", \"This is the last challenge we'll do for our Cat Photo App for now. We hope you've enjoyed learning Font Awesome, Bootstrap, and responsive design!\" ], \"tests\": [ \"assert($('.row').length > 4, 'Wrap your all of your checkboxes inside one div with the class \"row\".')\", \"assert($('.row').length > 4, 'Wrap your form submission button and text area in a div with class \"row\".')\", \"assert($('.col-xs-5').length > 0, 'Wrap your form submission button in a div with the class \"col-xs-5\".')\", \"assert($('.col-xs-7').length > 0, 'Wrap your form text area in a div with the class \"col-xs-7\".')\" ],"} +{"_id":"doc-en-freeCodeCamp-d187dca0878bafa11219167399cafff29b361df7c344b4a84f56fdf2b13bc3b1","title":"","text":"], \"MDNlinks\": [ \"Comparison Operators\", \"String.slice()\", \"Array.slice()\", \"Array.filter()\", \"Array.indexOf()\", \"String.concat()\" \"Array.concat()\" ], \"type\": \"bonfire\", \"challengeType\": 5,"} +{"_id":"doc-en-freeCodeCamp-5259fb492a096d424a0e81894aa61e6734de06b4cbecf5a272c48a7b07f9a562","title":"","text":"\"tests\": [ \"assert($(\"img\").hasClass(\"smaller-image\"), 'Your img element should have the class smaller-image.')\", \"assert($(\"img\").hasClass(\"thick-green-border\"), 'Your img element should have the class thick-green-border.')\", \"assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\")), 'Give your image a border width of 10px.')\", \"assert(new RegExp(\"solid\", \"gi\").test(editor), 'Give your image a border style of solid.')\", \"assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) === 10, 'Give your image a border width of 10px.')\", \"assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of solid.')\", \"assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img element should be green.')\" ], \"challengeSeed\": ["} +{"_id":"doc-en-freeCodeCamp-8f9328c9fcb0df2400ac3b5492a1096acc7e948a2b9735f2d0d069391b7dccc9","title":"","text":"], \"tests\": [ \"assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');\", \"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'one month apart can be inferred it is the next year');\", \"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');\", \"assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);\", \"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th, 2016']);\", \"assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');\","} +{"_id":"doc-en-freeCodeCamp-1ea516fca574d774df08fd3cd7024d9c027506ad092d391f85eb90371c20ee43","title":"","text":"\"dashedName\": \"waypoint-add-two-numbers-with-javascript\", \"difficulty\": \"9.98141\", \"description\": [ \"In JavaScript whole numbers (called integers) can be easily used to preform mathematical functions\", \"Let's try a few of the most commonly used ones now\", \"We use +for addition\", \"In JavaScript whole numbers (called integers) can be easily used to perform mathematical functions.\", \"Let's try a few of the most commonly used ones now.\", \"We use +for addition.\", \"Replace the 0with correct number to achieve the result in the comment.\" ], \"tests\": ["} +{"_id":"doc-en-freeCodeCamp-ef4b8e9a1d15441c22eadd99cea17b0f35e773238e351c541d9fb713c850b58e","title":"","text":"\"dashedName\": \"waypoint-subtract-one-number-from-another-with-javascript\", \"difficulty\": \"9.98142\", \"description\": [ \"In JavaScript whole numbers (called integers) can be easily used to preform mathematical functions\", \"Let's try a few of the most commonly used ones now\", \"We use -for subtraction\", \"In JavaScript whole numbers (called integers) can be easily used to perform mathematical functions.\", \"Let's try a few of the most commonly used ones now.\", \"We use -for subtraction.\", \"Replace the 0with correct number to achieve the result in the comment.\" ], \"tests\": ["} +{"_id":"doc-en-freeCodeCamp-fd75e49209914046fcbd6a674bd770d934e627992d9a590dbd60aec4cac132e4","title":"","text":"\"dashedName\": \"waypoint-multiply-two-numbers-with-javascript\", \"difficulty\": \"9.98143\", \"description\": [ \"In JavaScript whole numbers (called integers) can be easily used to preform mathematical functions\", \"Let's try a few of the most commonly used ones now\", \"We use *for multiplication\", \"In JavaScript whole numbers (called integers) can be easily used to perform mathematical functions.\", \"Let's try a few of the most commonly used ones now.\", \"We use *for multiplication.\", \"Replace the 0with correct number to achieve the result in the comment.\" ], \"tests\": ["} +{"_id":"doc-en-freeCodeCamp-b702c408e953e929e4a5b77c89907495383bac6ed0e0e31b32309c2f847558cc","title":"","text":"\"dashedName\": \"waypoint-divide-one-number-by-another-with-javascript\", \"difficulty\": \"9.9814\", \"description\": [ \"In JavaScript whole numbers (called integers) can be easily used to preform mathematical functions\", \"Let's try a few of the most commonly used ones now\", \"We use /for division\", \"In JavaScript whole numbers (called integers) can be easily used to perform mathematical functions.\", \"Let's try a few of the most commonly used ones now.\", \"We use /for division.\", \"Replace the 0with correct number to achieve the result in the comment.\" ], \"tests\": ["} +{"_id":"doc-en-freeCodeCamp-e008cab8cabad8a9d7e355aae27b95fae55ce5ff3b30470c8570570f2c9225e8","title":"","text":"\"dashedName\": \"waypoint-create-decimal-numbers-with-javascript\", \"difficulty\": \"9.9815\", \"description\": [ \"in JavaScript we can can work with decimal numbers\", \"In JavaScript we can can work with decimal numbers.\", \"Let's create a variable myDecimal and give it a decimal value.\" ], \"tests\": ["} +{"_id":"doc-en-freeCodeCamp-9d26900de8b7ce42665c7db2db58b6db9acb268ec613ceef224cd164e8be8ce3","title":"","text":"\"function functionName (a, b) {\", \"  return(a + b);\", \"}\", \"We can \"call\" our function like this: functionName();, and it will run and return it's return value to us.\", \"Create and call a function called myFunction.\" \"We can \"call\" our function like this: functionName();, and it will run and return its return value to us.\", \"Create and call a function called myFunction that returns the sum of a and b.\" ], \"tests\":[ \"assert((function(){if(typeof(f) !== \"undefined\" && typeof(f) === \"number\" && f === a + b && editor.getValue().match(/return/gi).length >= 1 && editor.getValue().match(/a/gi).length >= 1 && editor.getValue().match(/b/gi).length >= 1 && editor.getValue().match(/+/gi).length >= 1){return(true);}else{return(false);}})(), 'Your function should return the value of a + b');\""} +{"_id":"doc-en-freeCodeCamp-4dddf0d88dd771362f5a1f74d968671e6297b2b61cbe54a3f54e89e8824d3064","title":"","text":"\" return a - b;\", \"};\", \"\", \"//Don't modify above this line\", \"//Create a function called myFunction that returns the value of a plus b.\", \" // Only change code below this line.\", \"// Don't modify above this line\", \"// Create a function called myFunction that returns the value of a plus b.\", \"// Only change code below this line.\", \"\", \"\", \"\","} +{"_id":"doc-en-freeCodeCamp-8dd68b874a9bd5c36fe29d682013497115f9d58176c92caccc7e44eccc592d4d","title":"","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.\", \"if(typeof(myArray) !== \"undefined\" && typeof(data) !== \"undefined\"){(function(y,z){return('myArray = ' + JSON.stringify(y) + ', data = ' + JSON.stringify(z));})(myArray, data);}\" \"if(typeof(myArray) !== \"undefined\" && typeof(myData) !== \"undefined\"){(function(y,z){return('myArray = ' + JSON.stringify(y) + ', myData = ' + JSON.stringify(z));})(myArray, myData);}\" ], \"type\": \"waypoint\", \"challengeType\": 1"} +{"_id":"doc-en-freeCodeCamp-792fdc96e5461e88faa66584efb2e12ef40dd20282532e6e4ef086625e565bd7","title":"","text":"\"Try creating one of each.\" ], \"tests\":[ \"assert(editor.getValue().match(/(//)...../g), 'Create a // style comment that contains at least five letters');\", \"assert(editor.getValue().match(/(/*)...../g), 'Create a /* */ style comment that contains at least five letters.');\", \"assert(editor.getValue().match(/(*/)/g), 'Make sure that you close the comment with a */');\" \"assert(editor.getValue().match(/(//)...../g), 'Create a // style comment that contains at least five letters');\", \"assert(editor.getValue().match(/(/*)[wW]{5,}(?=*/)/gm), 'Create a /* */ style comment that contains at least five letters.');\", \"assert(editor.getValue().match(/(*/)/g), 'Make sure that you close the comment with a */');\" ], \"challengeSeed\":[ ],"} +{"_id":"doc-en-freeCodeCamp-3b24c2bcaa225e3723dda4eb6f6292c93e259efdb6ceb4b987c7ded2f7e5833a","title":"","text":"\"title\": \"Use Spans for Inline Elements\", \"difficulty\": 2.105, \"description\": [ \"You can use use spans to create inline elements. Remember when we used the btn-block class to make the button fill the entire row?\", \"You can use spans to create inline elements. Remember when we used the btn-block class to make the button fill the entire row?\", \"This image illustrates the difference between inline elements and block-level elements:\", \"\"An\", \"By using the span element, you can put several elements together, and even style different parts of the same element differently.\","} +{"_id":"doc-en-freeCodeCamp-3542290f48251a30ad49fb30a80607eaa07f2f3fd942a7f0ac69245920ea84f5","title":"","text":"\"description\": [ \"Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.\" ], \"challengeSeed\": \"function inventory(arr1, arr2) {n // All inventory must be accounted for or you're fired!rn return arr1;rn}nn// Example inventory listsrnvar curInv = [rn [21, 'Bowling Ball'],rn [2, 'Dirty Sock'],rn [1, 'Hair pin'],rn [5, 'Microphone']rn];rnrnvar newInv = [rn [2, 'Hair Pin'],rn [3, 'Half-Eaten Apple'],rn [67, 'Bowling Ball'],rn [7, 'Toothpaste']rn];rnrninventory(curInv, newInv);\", \"tests\": [ \"expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');\", \"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);\", \"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);\", \"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']]);\", \"assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]);\", \"assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [1, 'Dirty Sock'], [1, 'Hair pin'], [1, 'Half-Eaten Apple'], [1, 'Microphone'], [1, 'Toothpaste']]);\" \"challengeSeed\": \"function inventory(arr1, arr2) {n // All inventory must be accounted for or you're fired!rn return arr1;rn}nn// Example inventory listsrnvar curInv = [rn [21, 'Bowling Ball'],rn [2, 'Dirty Sock'],rn [1, 'Hair Pin'],rn [5, 'Microphone']rn];rnrnvar newInv = [rn [2, 'Hair Pin'],rn [3, 'Half-Eaten Apple'],rn [67, 'Bowling Ball'],rn [7, 'Toothpaste']rn];rnrninventory(curInv, newInv);\", \"tests\": [ \"expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');\", \"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);\", \"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);\", \"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);\", \"assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]);\", \"assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]);\" ] } ]"} +{"_id":"doc-en-freeCodeCamp-0af7ed915b422e2bfb3c300b02e299fd023f4bc8c3990022b2cacc60476a5eee","title":"","text":"\"});\" ], \"tests\":[ \"assert.deepEqual(array, [1,2,3,4], 'message: You should have removed all the values from the array that are greater than 4.');\", \"assert.deepEqual(array, [1,2,3,4,5], 'message: You should have removed all the values from the array that are greater than 5.');\", \"assert(editor.getValue().match(/array.filters*(/gi), 'message: You should be using the filter method to remove the values from the array.');\", \"assert(editor.getValue().match(/[1,2,3,4,5,6,7,8,9,10]/gi), 'message: You should only be using .filter to modify the contents of the array.');\" ],"} +{"_id":"doc-en-freeCodeCamp-c0e051a3a87be394d29dd6e183c003520275b44ccea80ece196326579202820a","title":"","text":"\"id\": \"bad87fee1348cd8acef08812\", \"title\": \"Create a Block Element Bootstrap Button\", \"description\": [ \"Normally, your button 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.\", \"Normally, your button 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.\", \"This image illustrates the difference between inline elements and block-level elements:\", \"\"An\", \"Note that these buttons still need the btn class.\","} +{"_id":"doc-en-freeCodeCamp-b776637ba9b70536e85baf365d896694f81ec78bee67b9f249365cc86bcf555e","title":"","text":"\"title\": \"Add ID Attributes to Bootstrap Elements\", \"description\": [ \"Recall that in addition to class attributes, you can give each of your elements an id attribute.\", \"Each id should be unique to a specific element.\", \"Each id must be unique to a specific element and used only once per page.\", \"Let's give a unique id to each of our div elements of class well.\", \"Remember that you can give an element an id like this: <div class=\"well\" id=\"center-well\">\", \"Give the well on the left the id of left-well. Give the well on the right the id of right-well.\""} +{"_id":"doc-en-freeCodeCamp-ee947bcf01e78cf8f2644faae49d5c81f77b05324d2f50e1bf9076dc294a7324","title":"","text":"req.flash('info', { msg: dedent` Once you have completed all of our challenges, you should join our Half Way Club and start getting join our Half Way Club and start getting ready for our nonprofit projects. `.split('n').join(' ') });"} +{"_id":"doc-en-freeCodeCamp-2b793d92821856427e5e89cb8ab7caccbe000d7bfd99ae7a27ca294372ca2231","title":"","text":"\"Bonus User Story: As a user, I navigate to different sections of the webpage by clicking buttons in the navigation.\", \"Don't worry if you don't have anything to showcase on your portfolio yet - you will build several apps on the next few CodePen challenges, and can come back and update your portfolio later.\", \"There are many great portfolio templates out there, but for this challenge, you'll need to build a portfolio page yourself. Using Bootstrap will make this much easier for you.\", \"Note that CodePen.io overrides the Window.open() function, so if you want to open windows using jquery, you will need to target invisible anchor elements like this one: <a target='_blank'>.\", \"Note that CodePen.io overrides the Window.open() function, so if you want to open windows using jQuery, you will need to target invisible anchor elements like this one: <a target='_blank'>.\", \"Remember to use Read-Search-Ask if you get stuck.\", \"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.\", \"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project.

Click here then add your link to your tweet's text\""} +{"_id":"doc-en-freeCodeCamp-6626c79c2218d94e1e54cc831109171ecfed093d9401793b92094788c60ecf9d","title":"","text":"\"description\": [ \"We're done playing with our jQuery playground. Let's tear it down!\", \"jQuery can target the body element as well.\", \"Here's how we would make the entire body fade out: $(\"body\").addClass(\"animated fadeOut\")\", \"Here's how we would make the entire body fade out: $(\"body\").addClass(\"animated fadeOut\");\", \"But let's do something more dramatic. Add the classes animated and hinge to your body element.\" ], \"tests\": ["} +{"_id":"doc-en-freeCodeCamp-305ad6a2c2cd1ea31d2580aba473cd12e738615748e2dc14c5bd082ad33c817c","title":"","text":"\"descriptionEs\": [ \"Hemos terminado de jugar en nuestro patio de recreo jQuery. ¡Vamos a derribarlo!\", \"jQuery también puede elegir el elemento body.\", \"Así es como haríamos que el cuerpo entero desapareciera: $(\"body\").addClass('animated fadeOut')\", \"Así es como haríamos que el cuerpo entero desapareciera: $(\"body\").addClass('animated fadeOut');\", \"Pero vamos a hacer algo más dramático. Añade las clases animated y hinge a tu elemento body.\" ] }"} +{"_id":"doc-en-freeCodeCamp-87a9b9a5d46248ce90f704ff5331d30a07b737a6b2b0b8ce2689fcf287a40702","title":"","text":"\"id\": \"cf1391c1c11feddfaeb4bdef\", \"title\": \"Create Decimal Numbers with JavaScript\", \"description\": [ \"We can store decimal numbers in variables too. Decimal numbers are sometimes refered to as floating point numbers or floats.\", \"We can store decimal numbers in variables too. Decimal numbers are sometimes referred to as floating point numbers or floats.\", \"Note
Not all real numbers can accurately be represented in floating point. This can lead to rounding errors. Details Here.\", \"

Instructions

\", \"Create a variable myDecimal and give it a decimal value.\""} +{"_id":"doc-en-freeCodeCamp-b08a0067a949e61f7fb5172c564a9cbb688d47a0c85e538c983c67a1bf60a443","title":"","text":"\"
5 % 2 = 1 because
Math.floor(5 / 2) = 2 (Quotient)
2 * 2 = 4
5 - 4 = 1 (Remainder)
\", \"Usage
In mathematics, a number can be checked even or odd by checking the remainder of the division of the number by 2.\", \"
17 % 2 = 1 (17 is Odd)
48 % 2 = 0 (48 is Even)
\", \"Note
The remainder operator is sometimes incorrectly refered to as the \"modulus\" operator. It is very similar to modulus, but does not work properly with negative numbers.\",
\"Note
The remainder operator is sometimes incorrectly referred to as the \"modulus\" operator. It is very similar to modulus, but does not work properly with negative numbers.\",
\"

Instructions

\", \"Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.\" ],"} +{"_id":"doc-en-freeCodeCamp-f004f1038239e414479c3850fb3d8358188a9a70101474e5d59c5388edad2e6c","title":"","text":"\"title\": \"Use Bracket Notation to Find the First Character in a String\", \"description\": [ \"Bracket notation is a way to get a character at a specific index within a string.\", \"Most modern programming languages, like JavaScript, don't start counting at 1 like humans do. They start at 0. This is refered to as Zero-based indexing.\", \"Most modern programming languages, like JavaScript, don't start counting at 1 like humans do. They start at 0. This is referred to as Zero-based indexing.\", \"For example, the character at index 0 in the word \"Charles\" is \"C\". So if var firstName = \"Charles\", you can get the value of the first letter of the string by using firstName[0].\", \"

Instructions

\", \"Use bracket notation to find the first character in the lastName variable and assign it to firstLetterOfLastName.\","} +{"_id":"doc-en-freeCodeCamp-2f285a05a9fe1fdd4811c0ea4dedc05986a46ed3c8be716d3cab944e1f4127fa","title":"","text":"\"id\": \"56533eb9ac21ba0edf2244d4\", \"title\": \"Comparison with the Greater Than Operator\", \"description\": [ \"The greater than operator (>) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns true. Otherwise, it returns false.
Like the equality operator, greater than operator will convert data types of values while comparing.\",
\"The greater than operator (>) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns true. Otherwise, it returns false.\", \"Like the equality operator, greater than operator will convert data types of values while comparing.\", \"Examples\", \"
5 > 3 // true
7 > '3' // true
2 > 3 // false
'1' > 9 // false
\", \"

Instructions

\","} +{"_id":"doc-en-freeCodeCamp-9f0da0991cc001c7be5f12e82895c75d027ff28a80302626cbbb49c209192ef1","title":"","text":"\"id\": \"56533eb9ac21ba0edf2244d5\", \"title\": \"Comparison with the Greater Than Or Equal To Operator\", \"description\": [ \"The greater than or equal to operator (>=) compares the values of two numbers. If the number to the left is greater than or equal to the number to the right, it returns true. Otherwise, it returns false.
Like the equality operator, greater than or equal to operator will convert data types while comparing.\",
\"The greater than or equal to operator (>=) compares the values of two numbers. If the number to the left is greater than or equal to the number to the right, it returns true. Otherwise, it returns false.\", \"Like the equality operator, greater than or equal to operator will convert data types while comparing.\", \"Examples\", \"
6 >= 6 // true
7 >= '3' // true
2 >= 3 // false
'7' >= 9 // false
\", \"

Instructions

\","} +{"_id":"doc-en-freeCodeCamp-c388caa38e4ce34a544b537011745761e1cb501457fbdef6723042de7f9be32a","title":"","text":"\"Al usar el elemento span, puedes poner varios elementos juntos, e incluso darle diferentes estilos a partes diferentes del mismo elemento.\", \"Anida la palabra \"love\" en tu elemento \"Things cats love\" dentro de un elemento span. Luego, asigna a ese elemento span la clase text-danger para hacer que el texto sea rojo.\", \"Así es como lo harías con el elemento \"Top 3 things cats hate\":\", \"<p>Top 3 things cats <span class = \"text-danger\">hate</span></p>\" \"<p>Top 3 things cats <span class = \"text-danger\">hate:</span></p>\" ] }, {"} +{"_id":"doc-en-freeCodeCamp-5067602d791d4a264e335047351d5a837652d340b9c3c207d21edc245a99bcb6","title":"","text":"\"challengeType\": 0, \"nameEs\": \"Crea un encabezado personalizado\", \"descriptionEs\": [ \"Crearemos un encabezado simple para nuestra aplicación de fotos de gatos poniéndolos en la misma línea.\", \"Crearemos un encabezado simple para nuestra aplicación de fotos de gatos poniendo el título y la relajante imagen del gato en la misma línea.\", \"Recuerda, Bootstrap usa un sistema de cuadrícula adaptativo, el cual facilita poner elementos en filas y especificar el ancho relativo de cada elemento. La mayoría de las clases de Bootstrap pueden aplicarse a un elemento div.\", \"Aquí hay un diagrama del funcionamiento de la cuadrícula de 12 columnas Bootstrap:\", \"\"una\","} +{"_id":"doc-en-freeCodeCamp-d11683a63fae007da081662edc19a9468a12bc5e95bfb8ae3515f7b8096e8e40","title":"","text":"\"nameEs\": \"Agrega iconos de Font Awesome a los botones\", \"descriptionEs\": [ \"Font Awesome es una librería de iconos muy conveniente. Estos iconos son imágenes vectoriales, almacenadas en formato .svg, y son tratados como si fueran fuentes. Puedes especificar su tamaño usando pixeles, y tomarán el tamaño de fuente de su elemento HTML padre.\", \"Puedes añadir Font Awesome a cualquier aplicación sólo incluyendo y agregando el siguiente código al comienzo de tu HTML:\", \"<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\"/>\", \"En este caso, ya lo hemos agregado por tí a esta página tras bambalinas.\", \"El elemento i originalmente era usado para hacer textos en itálicas, pero ahora comunmente se usa para iconos. Le agregas clases de Font Awesome al elemento i para convertirlo en un ícono, por ejemplo:\", \"<i class=\"fa fa-info-circle\"></i>\", \"Usa Font Awesome para agregar un icono de \"pulgar arriba\" thumbs-up a tu botón de like dándole un elemento i con las clases fa y fa-thumbs-up.\" ] },"} +{"_id":"doc-en-freeCodeCamp-fba143451c7a673ecceebee38b89cb50a50f066ba9c2a8dc1fca96a4954e56af","title":"","text":"\"Vamos a darle un id único a cada uno de nuestros elementos div que tienen la clase well.\", \"Recuerda que puedes darle a un elemento un id como el siguiente:\", \"<div class=\"well\" id=\"center-well\">\", \"Dale al pozo de la izquireda el id left-well. Al pozo de la derecha, dale un id de right-well.\" \"Dale al pozo de la izquireda el id left-well. Al pozo de la derecha, dale un id right-well.\" ] }, {"} +{"_id":"doc-en-freeCodeCamp-4ef94076ab29296e7d56e0c792df90d94c63e6534b62ccf74d1db1cca3d217f5","title":"","text":"\"nameEs\": \"Dale a cada elemento un ID único\", \"descriptionEs\": [ \"También quisiéramos referirnos a cada botón por su id utilizando jQuery.\", \"Dale a cada uno de tus botones un id único, comenzando con target1 y terminando con target6.\" \"Dale a cada uno de tus botones un id único, comenzando con target1 y terminando con target6.\", \"Asegúrate que target1 a target3 queden en #left-well, mientras que target4 a target6 queden en #right-well.\" ] }, {"} +{"_id":"doc-en-freeCodeCamp-d677594f060323c97c3600a24aa5f6339bf860ab8f88909e8ae3fc071ea96446","title":"","text":"\"tests\": [ \"assert($(\"#left-well\").css(\"background-color\") === 'red' || $(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#ff0000' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#f00', 'message: Your left-well element should have a red background.');\", \"assert(code.match(/.parents*()s*.css/g), 'message: You should use the .parent() function to modify this element.');\", \"assert(code.match(/$s*?(s*?(?:'|\")s*?#target1s*?(?:'|\")s*?).parent/gi), 'message: The .parent() method should be called on the #target1 element.');\", \"assert(code.match(/$s*?(s*?(?:'|\")s*?#target1s*?(?:'|\")s*?)s*?.parent/gi), 'message: The .parent() method should be called on the #target1 element.');\", \"assert(code.match(/
/g), 'message: Only use jQuery to add these classes to the element.');\" ], \"type\": \"waypoint\","} +{"_id":"doc-en-freeCodeCamp-697abb99502cf65652db8661648f0de3bee8fbcae612a7692b4e08c0c430f29e","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Elementos\", \"descriptionEs\": [ \"Esta es información básica y una mini-lección sobre la pestaña Elements en las herramientas de desarrollo de Chrome. Echa un vistazo a la documentación más detallada aquí: developers.google.com/web/tools/iterate/inspect-styles/basics \", \"Vamos a utilizar la página web mckellen.com/ por sugerencia del usuario de FreeCodeCamp kmiasko.\", \"Si pulsas con el botón derecho y seleccionas 'Inspeccionar elemento', tendrás acceso a la pestaña elements. ¡Puedes cambiar el texto, el color de fondo, el color de texto y cualquier otra propiedad CSS o elemento HTML que desees!\", \"Estos cambios no se establecen de forma automática, por lo que no debes usar el inspector como un IDE o como un lugar para crear o editar cualquier cosa que desees guardar. Puedes configurar algo que se llama 'autoría persistente' para salvar.\", \"Las reglas de CSS como cascada, herencia y otras se aplican, así que tenlo en cuenta a medida que juegas. Además, los estilos anulados se muestran con un tachado sobre ellos. \", \"También hay que señalar que todo el código que veas en ese 'árbol' es código HTML actual, no el original que había cuando se cargó la página. Si utilizas jQuery o JavaScript para cambiar algo, esté árbol se actualizará.\", \"El relleno, los bordes y los márgenes se inspeccionan fácilmente y puedes editarlos usando la caja con colores que encontrarás al lado derecho o en la parte de abajo.\", \"Por favor, echa un vistazo a la documentación de las herramientas de desarrollo de Chrome en developers.google.com/web/tools/chrome-devtools/\" ] }, { \"id\": \"56b15f15632298c12f315183\","} +{"_id":"doc-en-freeCodeCamp-cc695a8cddb673c30d75c8493093cb1feae1ab3f3c74d3e2b06bd76203f8957c","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: red\", \"descriptionEs\": [ \"La pestaña network (red) ayuda a responder preguntas como '¿Qué elemento o parte de la página fue el más demorado?' o '¿Qué inició una petición?'\", \"El panel de red registra información detallada sobre cuánto tarda en cargar cada elemento de su página o aplicación.\", \"Cada solicitud se registra en la bitácora, que se puede encontrar en la parte inferior del panel de red.\", \"Si te fijas en la línea al lado derecho, te darás cuenta de un patrón de colores. Cada color representa un tipo diferente de contenido en la solicitud. \", \"Cuanto más larga sea la línea de un color determinado, tanto más tiempo tomó ese tipo de contenido en la solicitud. En últimas quieres líneas cortas, y si cualquier solicitud tiene largas líneas, sabes que puede estar ralentizando la página web.\", \"Si pulsas sobre una solicitud en la bitácora, podrás obtener información más detallada.\", \"Consulta más documentación detallada aquí: developers.google.com/web/tools/profile-performance/network-performance/resource-loading\" ] }, { \"id\": \"56b15f15632298c12f315182\","} +{"_id":"doc-en-freeCodeCamp-125f4612904460b3d9f49788ade2a5a24caeaa5a99d50fdfd2e8a1769f105eb0","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Fuentes\", \"descriptionEs\": [ \"La pestaña 'fuentes' es más útil para la depuración de JavaScript. Cuanto más grande sea tu proyecto, tanto más difícil resulta encontrar exactamente dónde se produce un problema. \", \"Puedes seleccionar diferentes partes del código para ser 'puntos de interrupción', puestos de control que detendrán la ejecución del código en ese preciso momento. \", \"Hay diferentes puntos de interrupción que puedes establecer, por ejemplo una línea de código específica, un evento del DOM, una petición del servidor llamada solicitud XMLHTTP, o un evento de JavaScript.\", \"Cuando estableces un punto de interrupción, el navegador detiene todo cuando llega a interpretar esa línea de código o evento.\", \"Al reducir la velocidad de todo y darte la oportunidad de examinar lo que está sucediendo en cada punto que hayas configurado, podrás controlar exactamente lo que está sucediendo en la página o aplicación.\", \"Una vez has establecido todos los puntos de interrupción, puedes recorrer el código y examinar el estado de tu página o aplicación en cada punto de interrupción.\", \"Al igual que con los elementos, puedes editar en vivo mediante las herramientas de desarrollo, pero recuerda que debes guardar esos cambios para que no pierdas tu progreso.\", \"Revisa documentación más detallada aquí: developers.google.com/web/tools/javascript/breakpoints/\" ] }, { \"id\": \"56b15f15632298c12f315181\","} +{"_id":"doc-en-freeCodeCamp-639fa9c742877d0ed523b5a12d9fc633e1b0706f5e2c05dd06dc590ab8f82d3b","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Línea de tiempo\", \"descriptionEs\": [ \"El panel Línea de tiempo te permite grabar y analizar toda la actividad en tu aplicación mientras se ejecuta. Es el mejor lugar para comenzar a investigar los problemas de rendimiento que percibas en tu aplicación. \", \"Al igual que usas el panel de red para averiguar cuánto tiempo toman las partes de la página para comunicarse con el Internet y utilizas fuentes para averiguar dónde algo se daña, puedes utilizar la línea de tiempo para averiguar con más detalle lo que está pasando y el tiempo que tarda.\", \"En el panel línea de tiempo grabas acontecimientos con el pequeño botón circular. Puedes grabar (o capturar) pilas, perfiles js, la memoria y la presentación (CSS). \", \"Al grabarlos (capturalos), quedan en pequeños y detallados registros que puedes organizar de muchas maneras para que se adapten a tus necesidades.\", \"Todo esto te ayudará a entender mejor lo que está pasando en el navegador, en particular cuáles eventos requieren más memoria del navegador.\", \"Cuando uses la línea de tiempo, recuerda que debes utilizar el botón 'limpiar' (clear) para iniciar la grabación y antes de cargar la página, dependiendo de lo que desees capturar.\", \"Te darás cuenta de que cuando grabas eventos JS, al pulsar en el título o en una 'llamada a una función' al lado izquierdo, te llevará al documento y a la línea de esa función en el panel de recursos. \", \"Revisa documentación más detallada aquí: developers.google.com/web/tools/profile-performance/evaluate-performance/timeline-tool\" ] }, { \"id\": \"56b15f15632298c12f315180\","} +{"_id":"doc-en-freeCodeCamp-3540d87ada4d72958b76fe0577921150332a0c5b28d69334e1cb4dd6c6669ffe","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Perfiles\", \"descriptionEs\": [ \"El panel Perfiles te permite perfilar el tiempo de ejecución y el uso de memoria de una aplicación web o de una página. Esto se aplica principalmente a la ejecución de JavaScript en su página o aplicación. \", \"Hay tres tipos de perfiles que se pueden recolectar: el perfil de la CPU, instantáneas de la memoria con estructura montón (Heap), y el perfil de la memoria con estructura montón. Los perfiles de memoria en estructura montón tienen más que ver con el uso de memoria, mientras que un perfil de la CPU tiene más que ver con el rendimiento de JavaScript. \", \"Un perfilador llamado V8 se usa mientras se ejecuta el código para identificar lo que en el JavaScript toma mucho tiempo, facilitándote de esta forma optimizar tu código.\", \"Cada uno de estos perfiles se puede ver a la izquierda, y se puede tomar múltiples perfiles de cada uno. En general, la pestaña de perfiles es muy útil cuando deseas optimizar tu código. \", \"Revisa documentación más detallada aquí: developers.google.com/web/tools/profile-performance/rendering-tools/js-execution\" ] }, { \"id\": \"56b15f15632298c12f31517f\","} +{"_id":"doc-en-freeCodeCamp-18dbebf71a1e569fdd9b589a6ebf7718c1f113ef6211ad1b74bb3247882d4843","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Recursos\", \"descriptionEs\": [ \"El panel de Recursos te permite inspeccionar los recursos que se cargan en la página, incluyendo IndexedDB o bases de datos SQL Web, almacenamiento local y de sesión, las galletas (cookies), memoria caché de aplicaciones, imágenes, fuentes y hojas de estilo.\", \"Puedes ver y editar toda esta información dentro del navegador.\", \"A medida que vayas construyendo aplicaciones web más avanzadas, juega con el panel de recursos y verás cómo te ayudará a entender los requisitos de tu aplicación y de tu página en tiempo real.\", \"Revisa documentación más detallada aquí: developers.google.com/web/tools/iterate/manage-data/index\" ] }, { \"id\": \"56b15f15632298c12f31517e\","} +{"_id":"doc-en-freeCodeCamp-d2537a8a7042b4238f2d79ee22015ae8b21b9fc850dfbc18fc943de2b7be9b47","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Las auditorías\", \"descriptionEs\": [ \"La herramienta de auditoría te guía para mejorar tu página paso a paso.\", \"En este vídeo, se utiliza esta herramienta con un generador de citas aleatorias desarrollado como uno de los proyectos de desarrollo de interfaces.\", \"Las sugerencias que se ven, se generan automáticamente con la función de auditoría.\", \"Es importante tenerlas en cuenta para contextualizarlos con el resto de conocimiento que tienes de tu sitio.\", \"A veces, puede ser que sea lo acertado, pero en ocasiones, por tu situación las sugerencias que da son equivocadas.\", \"Usa esta herramienta cuando desees mejorar tu sitio o aplicación, pero no sepas por dónde empezar.\" ] }, { \"id\": \"56b15f15632298c12f31517d\","} +{"_id":"doc-en-freeCodeCamp-8fd8e3ccb34f78480c1d57fbb31ce9101fcc36452a8adb6b9f11ac804fd927fc","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Consola\", \"descriptionEs\": [ \"El panel de la consola ofrece dos funciones principales: registro de datos de diagnóstico en el proceso de desarrollo y proporcionar un intérprete de órdenes que puedes utilizar para interactuar con el documento y las Herramientas de desarrollo\", \"Al utilizar la consola, puedes ver los datos en bruto o estructurados mediante instrucciones estándar JS y órdenes específicas para la consola.\", \"Un ejemplo de datos estructurados sería la información JSON que devuelva una API. Muy útil cuando se construyen las primeras aplicaciones de desarrollo de interfaces para FreeCodeCamp.\", \"Debes saber que los mensajes se apilan y que puedes limpiarlos escribiendo clear(). También puedes guardar la bitácora seleccionando 'Preserve Log'. \", \"Hay diferentes órdenes que registrarán en bitácoras de manera diferente, como console.log() para registrar información básica, console.error() y console.warn() para registrar en bitácoras 'información llamativa'.\", \"La consola puede realizar un seguimiento de excepciones, que básicamente registra cuando algo sale mal. Puede incluso hacer una pausa en el código durante esas excepciones, función que posiblemente recuerdes de la pestaña 'Fuente'. \", \"Revisa documentación más detallada aquí: developers.google.com/web/tools/javascript/console/\" ] }, { \"id\": \"56b15f15632298c12f31517c\","} +{"_id":"doc-en-freeCodeCamp-6c359b9b16dc5e61b0967e71d1ef20ebd65edced77028059095b62534400907a","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"Herramientas de desarrollo de Chrome: Resumen\", \"descriptionEs\": [ \", Las herramientas de desarrollo de Chrome son impresionantes, y cuanto más te puedas sumergir y tratar de utilizarlas, más rápido aumentará tu nivel. \", \", Utiliza la documentación, incluso si nunca has leído documentación antes: developers.google.com/web/tools/chrome-devtools/ \", \", Una vez que comiences a sentirte cómodo en una pestaña, rétate aprendiendo a usar una diferente. Trabajar eficazmente con todas las pestañas te servirá exponencialmente más que pegarte en tu zona de confort.\" ] } ] }"} +{"_id":"doc-en-freeCodeCamp-e774f67d80e823ddcc5ae0c890f8041c50647f034c716f7ac16dcb19f862f014","title":"","text":"\"challengeType\": 3, \"nameEs\": \"Crea una calculadora JavaScript\", \"descriptionEs\": [ \"Objetivo: Crea una aplicación con CodePen.io que reproduzca efectivamente mediante ingeniería inversa este app: http://codepen.io/FreeCodeCamp/full/zrRzMR.\", \"Objetivo: Crea una aplicación con CodePen.io cuya funcionalidad sea similar a esta: http://codepen.io/FreeCodeCamp/full/zrRzMR.\", \"Regla #1: No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.\", \"Regla #2: Puedes usar cualquier librería o APIs que necesites.\", \"Regla #3: Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.\", \"Las siguientes son las historias de usuario que debes satisfacer, incluyendo las historias opcionales:\", \"Historia de usuario: Como usuario, puedo sumar, restar, multiplicar y dividir dos números.\", \"Regla #2: Satisface las siguientes historias de usuario. Usa cualquier librería o API que necesites. Dale tu estilo personal.\", \"Historia de usuario: Puedo sumar, restar, multiplicar y dividir dos números.\", \"Historia de usuario opcional: Puedo limpiar la pantalla con un botón de borrar.\", \"Historia de usuario opcional: Puedo concatenar continuamente varias operaciones hasta que pulse el botón de igual, y la calculadora me mostrará la respuesta correcta.\", \"Recuerda utilizar Read-Search-Ask si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.\", \"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen.

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

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

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

Pulsa aquí y agrega tu link en el texto del tweet\"
\"Recuerda utilizar Leer-Buscar-Preguntar si te sientes atascado.\", \"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un enlace a tu CodePen.\", \"Puedes obtener retroalimentación sobre tu proyecto por parte de otros campistas, compartiéndolo en nuestra Sala de chat para revisión de código. También puedes compartirlo en Twitter y en el campamento de tu ciudad (en Facebook).\" ], \"isRequired\": true } ] } No newline at end of file } "} +{"_id":"doc-en-freeCodeCamp-c263dec51cd267a2f234e2ed04d58ddcd4e5b39f4e21ff2a285ec58f51170c0c","title":"","text":"\"video\": \"114591799\", \"challengeNumber\": 13, \"steps\": [ \"Now that we've built a foundation in jQuery, let's go back to Dash and do it's last challenge.\", \"Now that we've built a foundation in jQuery, let's go back to Dash and do its last challenge.\", \"If you aren't familiar with Mad Libs, they basically involve inserting random nouns, adjectives and verbs in to stories. The stories that result are often hilarious.\", \"Go to https://dash.generalassemb.ly/projects/mad-libs-1 and complete the fifth project.\" ]"} +{"_id":"doc-en-freeCodeCamp-52c36d0cb49026c6e252e7b9df71672889ec5f8ae22712cf9d761764e3780348","title":"","text":"transform: translateY(-50%); } .landing-skill-icon { color: #215f1e; font-size: 150px; } .black-text { color: #333; font-weight: 400; font-size: 40px; } .font-awesome-padding { margin-top: 45px; margin-bottom: 20px; } .background-svg { width: 220px; height: 220px;"} +{"_id":"doc-en-freeCodeCamp-dcd93f573fe9b6449e6dead840938b11a7be5ab4fee6d9b25b12eccef7f9f2fa","title":"","text":"background-position: center; } .testimonial-image { border-radius: 5px; height: 200px; width: 200px; } .testimonial-copy { font-size: 20px; text-align: center; @media (min-width: 991px) and (max-width: 1199px) { height: 120px; } @media (min-width: 1200px) { height: 90px; } } //uncomment this to see the dimensions of all elements outlined in red //* { // border-color: red;"} +{"_id":"doc-en-freeCodeCamp-716ed0a99336d96c333a5894aad136a78559c688b8998eec06621cb6e6341f2d","title":"","text":"extends layout block content .hidden-xs a(href='https://github.com/freecodecamp/freecodecamp') img(style='position: absolute; top: 40; right: 0; border: 0; margin-top: -30px;', src='https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67', alt='Fork me on GitHub', data-canonical-src='https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png') .jumbotron .text-center h1.hug-top Code with Us"} +{"_id":"doc-en-freeCodeCamp-7b96a1fd6254002bca9bd99a4d8e54ddadb4f6b9df0c4b588fb16916994c1057","title":"","text":"br br a.btn.nonprofit-cta.btn-success(href=\"/nonprofits\") I'm with a nonprofit and want help coding something include partials/about include partials/faq No newline at end of file .big-break h2 Campers you'll hang out with: .row .col-xs-12.col-sm-12.col-md-4 img.img-responsive.testimonial-image.img-center(src=\"https://s3.amazonaws.com/freecodecamp/testimonial-jen.jpg\", alt=\"@jenthebest's testimonial image\") .testimonial-copy Getting back on track with Free Code Camp and committing to a new career in 2015! h3 - @jenthebest .col-xs-12.col-sm-12.col-md-4 img.img-responsive.testimonial-image.img-center(src=\"https://s3.amazonaws.com/freecodecamp/testimonial-tate.jpg\", alt=\"@TateThurston's testimonial image\") .testimonial-copy Just built my company's website with skills I've learned from Free Code Camp! h3 - @TateThurston .col-xs-12.col-sm-12.col-md-4 img.img-responsive.testimonial-image.img-center(src=\"https://s3.amazonaws.com/freecodecamp/testimonial-cynthia.jpg\", alt=\"@cynthialanel's testimonial image\") .testimonial-copy I'm currently working through Free Code Camp to improve my JavaScript. The community is very welcoming! h3 - @cynthialanel .big-break h2 Skills you'll learn: .text-center .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-html5 .black-text HTML5 .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-css3 .black-text CSS3 .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-javascript .black-text JavaScript .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.fa.fa-database.font-awesome-padding .black-text Databases .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-chrome .black-text DevTools .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-nodejs .black-text Node.js .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-social-angular .black-text Angular.js .col-xs-12.col-sm-12.col-md-3 .landing-skill-icon.ion-ios-loop-strong .black-text Agile .big-break h2   h2 Fast facts about our community: h3.col-xs-offset-0.col-sm-offset-1.col-md-offset-2 ul.text-left li.ion-code   We're 100% free and open source li.ion-code   We're thousands of professionals who are learning to code li.ion-code   We're building projects for dozens of nonprofits li.ion-code   We share one goal: to boost our careers with code .big-break a.btn.btn-cta.signup-btn(href=\"/login\") Start learning to code (it's free) No newline at end of file"} +{"_id":"doc-en-freeCodeCamp-eff1cbf87f49bdb86166089047268cc20edea8b355ab116cc7276b579f99a8fc","title":"","text":"\"challengeSeed\": \"function sumPrimes(num) {n return num;rn}\", \"tests\": [ \"expect(sumPrimes(10)).to.be.a('number');\", \"expect(sumPrimes(10)).to.equal(27);\", \"expect(sumPrimes(10)).to.equal(17);\", \"expect(sumPrimes(977)).to.equal(73156);\" ] },"} +{"_id":"doc-en-freeCodeCamp-e9ae86693e537085f6ea767608db9510676c29be39db7b885c9dcf2a3f3da7c2","title":"","text":"], \"description\": [ \"You can add the fa-paper-plane Font Awesome icon by adding <i class=\"fa fa-paper-plane\"></i> within your submit button element.\", \"Give your form's text input field a class of form-control. Give your form's submit button the classes btn btn-primary. Also give this button the Font Awesome icon of fa-paper-plane.\" \"Give your form's text input field a class of form-control. Give your form's submit button the classes btn btn-primary. Also give this button the Font Awesome icon of fa-paper-plane.\", \"All textual <input>, <textarea>, and <select> elements with the class .form-control have a width of 100%.\" ], \"challengeSeed\": [ \"\","} +{"_id":"doc-en-freeCodeCamp-089373e27da324936089b8a63a9d6d8b73ad51a2eeec19c909d89ef8d2439e3f","title":"","text":"var isCompletedDate = Math.round(+new Date() / 1000); var bonfireHash = req.body.bonfireInfo.bonfireHash; var isSolution = req.body.bonfireInfo.solution; // TODO debug(isCompletedWith, 'Is completed with'); if (isCompletedWith) { var paired = User.find({\"profile.username\": isCompletedWith}).limit(1);"} +{"_id":"doc-en-freeCodeCamp-f7074bae61dcd81de65837566cf89d83674231ca217d856ad305b1a7d1cc69c7","title":"","text":"throw err; } if (user && paired) { res.redirect('/bonfires'); res.send(true); } }) }); } }) } else { req.user.completedBonfires.push({ _id: bonfireHash, completedWith: null,"} +{"_id":"doc-en-freeCodeCamp-1aa605eb80df2e320f6bdcef16b66b99449cfa6f473136fc8c6ad4df6a5c13d1","title":"","text":"}) var index = req.user.uncompletedBonfires.indexOf(bonfireHash); if (index > -1) { req.user.uncompletedBonfires.splice(index,1) } req.user.save(function(err, user) { if (err) { throw err; } if (user) { res.redirect('/bonfires'); debug('Saving user'); res.send(true) } }); } }); // Unique Check API route"} +{"_id":"doc-en-freeCodeCamp-f13680d0435cbf36b53065c1665d2b3993eb4fc29c4c9b491948f6b895a9b5b6","title":"","text":"return res.redirect('bonfires/meet-bonfire'); } var currentTime = parseInt(+new Date() / 1000); if (currentTime - req.user.lastContentSync > 86400) { if (currentTime - req.user.lastContentSync > 10) { req.user.lastContentSync = currentTime; var completed = req.user.completedBonfires.map(function (elem) { return elem._id;"} +{"_id":"doc-en-freeCodeCamp-d326d6e516d4f955644f304ed99477c67416e8e0bcf19d62678c0f75e9848582","title":"","text":"} } }); } if (allTestsPassed) { allTestsPassed = false; showCompletion(); if (allTestsPassed) { allTestsPassed = false; showCompletion(); } } };"} +{"_id":"doc-en-freeCodeCamp-34ba44f798213a4465db989b4db08a15c66d640af01449fe72559acadc768bd2","title":"","text":"$('#complete-bonfire-dialog').modal('show'); // Only post to server if there is an authenticated user if ($('.signup-btn-nav').length < 1) { $.ajax({ type: 'POST', data: { $.post( '/completed-bonfire', { bonfireInfo: { completedWith : didCompleteWith, solution: bonfireSolution, bonfireHash: thisBonfireHash } }, url: '/completed-bonfire/' }); function(res) { if (res) { window.location.href = 'http://localhost:3001/bonfires' } }) } } $('.next-bonfire-button').on('click', function() { var bonfireSolution = myCodeMirror.getValue(); var thisBonfireHash = passedBonfireHash || null; var didCompleteWith = $('#completed-with').val() || null; completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash); }); $('.all-challenges').on('click', function() { $('#all-challenges-dialog').modal('show'); });"} +{"_id":"doc-en-freeCodeCamp-b99abe611b9ae009172884f0e6499581d69957110f62eda1ff6d4511423202da","title":"","text":"}); $('.next-bonfire-button').on('click', function() { var bonfireSolution = myCodeMirror.getValue(); var thisBonfireHash = passedBonfireHash || null; var didCompleteWith = $('#completed-with').val() || null; completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash); window.setTimeout(function() { // TODO window.location = '/bonfires'; }, 100); }); // Bonfire instructions functions $('#more-info').on('click', function() {"} +{"_id":"doc-en-freeCodeCamp-a7d53ab195efcf5132dcaed837cbc67e8577b76100a1482541e47c66bcca366d","title":"","text":"\"Return the provided string with the first letter of each word capitalized.\", \"For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.\" ], \"challengeEntryPoint\": \"titleCase(\"I'm a little tea pot\")\", \"challengeEntryPoint\": \"titleCase(\"I'm a little tea pot\");\", \"challengeSeed\": \"function titleCase(str) {n return str;rn}\", \"tests\": [ \"expect(titleCase(\"I'm a little tea pot\")).to.be.a('String');\","} +{"_id":"doc-en-freeCodeCamp-1a5fe3b66265ae259e7197b946b59f0eb9b4a9f288d5511af1ab779e6676bc05","title":"","text":"\"difficulty\": \"1.06\", \"description\": [ \"Return an array consisting of the largest numbers in the provided array. The array will contain 4 sub-arrays.\", \"Remember, you an iterate through an array with a simple for loop, and access each member with array syntax arr[i] .\", \"Remember, you can iterate through an array with a simple for loop, and access each member with array syntax arr[i] .\", \"If you are writing your own Chai.js tests, be sure to use a deep equal statement instead of an equal statement when comparing arrays.\" ], \"challengeEntryPoint\": \"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);\","} +{"_id":"doc-en-freeCodeCamp-3663f39a0d0c30e4a73e5a1e20fc84648dc54c1d05138d3d5b62719233472d44","title":"","text":"\"name\": \"Sum All Odd Fibonacci Numbers\", \"difficulty\": \"2.09\", \"description\": [ \"Return the sum of all odd fibonacci numbers up to and including the passed number if it is a fibonacci number.\", \"Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.\", \"The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.\", \"As an example, passing 4 to the function should return 5 because all the odd fibonacci numbers under 4 are 1, 1, and 3.\" \"As an example, passing 4 to the function should return 5 because all the odd Fibonacci numbers under 4 are 1, 1, and 3.\" ], \"challengeEntryPoint\": \"sumFibs(4);\", \"challengeSeed\": \"function sumFibs(num) {n return num;rn}\","} +{"_id":"doc-en-freeCodeCamp-1ccca0566b647002ae9cd7be0892bc3bbea0e7abbf4d32d9acb57d32a0baea1c","title":"","text":"\"difficulty\": \"2.10\", \"description\": [ \"Sum all the prime numbers up to and including the provided number.\", \"A prime number is defined as having only two divisors, 1 and itself. For example, 2 is a prime number because it's only divisible by 1 and 2. 1 isn't a prime number, because it's only divisible by itself.\", \"A prime number is defined as having only two divisors, 1 and itself. For example, 2 is a prime number because it's only divisible by 1 and 2. 1 isn't a prime number, because it's only divisible by itself.\", \"The provided number may not be a prime.\" ], \"challengeEntryPoint\": \"sumPrimes(10);\","} +{"_id":"doc-en-freeCodeCamp-b92f786cf47b089e688a9268fad561e27601a0ef2dc2b7d6ceadd9d337718b00","title":"","text":"\"Fill in the object constructor with the methods specified in the tests.\", \"Those methods are getFirstName(), getLastName(), getFullName(), setFirstName(), setLastName(), and setFullName().\", \"These methods must be the only available means for interacting with the object.\", \"There will be some linting errors on the tests, you may safely ignore them. You should see undefined in the console output.\" \"There will be some linting errors on the tests. You may safely ignore them. You should see undefined in the console output.\" ], \"challengeEntryPoint\": \"var bob = new Person('Bob Ross');\", \"challengeSeed\": \"var Person = function(firstAndLast) {n return firstAndLast;rn};\","} +{"_id":"doc-en-freeCodeCamp-4cf015d64b8096c83a3c991ba3970153e6ccad7983065f9b5e8fe7150ffbe36f","title":"","text":"\"Return true if the passed string is a valid US phone number\", \"The user may fill out the form field any way they choose as long as it is a valid US number. The following are all valid formats for US numbers:\", \"555-555-5555, (555)555-5555, (555) 555-5555, 555 555 5555, 5555555555, 1 555 555 5555\", \"For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false.\" \"For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false.\" ], \"tests\": [ \"expect(telephoneCheck(\"555-555-5555\")).to.be.a(\"boolean\");\","} +{"_id":"doc-en-freeCodeCamp-8d8ea5d8486b166e7c36f1a598e6a4fc2219493fc913103ecccb8e7ebb07648f","title":"","text":"\"id\": \"bd7158d8c443eddfaeb5bdee\", \"title\": \"Build a Pinterest Clone\", \"description\": [ \"Objective: Build a full stack JavaScript app that is functionally similar to this: https://midnight-dust.hyperdev.space and deploy it to Heroku.\", \"Objective: Build a full stack JavaScript app that is functionally similar to this: https://midnight-dust.glitch.me and deploy it to Heroku.\", \"Note that for each project, you should create a new GitHub repository and a new Heroku project. If you can't remember how to do this, revisit https://freecodecamp.com/challenges/get-set-for-our-dynamic-web-application-projects.\", \"Here are the specific user stories you should implement for this project:\", \"User Story: As an unauthenticated user, I can login with Twitter.\","} +{"_id":"doc-en-freeCodeCamp-0cf5fbe98aeea9e72623bbc88b6dc1790085729d2a740eb147c3dd4fa5799696","title":"","text":"\"type\": \"basejump\", \"challengeType\": 4, \"descriptionEs\": [ \"Objetivo: Construye una aplicación de pila completa (full stack) en JavaScript que funcione de forma similar al siguiente proyecto: https://midnight-dust.hyperdev.space/ y despliégalo en Heroku.\", \"Objetivo: Construye una aplicación de pila completa (full stack) en JavaScript que funcione de forma similar al siguiente proyecto: https://midnight-dust.glitch.me/ y despliégalo en Heroku.\", \"Ten en cuenta que para cada proyecto, debes crear un nuevo repositorio en GitHub y un nuevo proyecto en Heroku. Si no recuerdas cómo hacerlo, visita de nuevo https://freecodecamp.com/challenges/get-set-for-our-dynamic-web-application-projects.\", \"Estas son las Historias de usuario que debes satisfacer para este Basejump:\", \"Historia de usuario: Como usuario autenticado, puedo acceder a mi cuenta con Twitter.\","} +{"_id":"doc-en-freeCodeCamp-8779945521524215017beefc91423cbea868f29e441bb8a520242b7a8df7c370","title":"","text":"] }, { \"_id\": \"5900f3831000cf542c50fe95\", \"challengeType\": 5, \"type\": \"bonfire\", \"title\": \"Problem 22: Names scores\", \"tests\": [ \"assert.strictEqual(euler22(), 871198282, 'message: euler22() should return 871198282.');\" ], \"solutions\": [], \"translations\": {}, \"challengeSeed\": [ \"function euler22() {\", \" // Good luck!\", \" return true;\", \"}\", \"\", \"euler22();\" ], \"description\": [ \"Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.\", \"For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 × 53 = 49714.\", \"What is the total of all the name scores in the file?\" ] }, { \"_id\": \"5900f3831000cf542c50fe96\", \"challengeType\": 5, \"type\": \"bonfire\","} +{"_id":"doc-en-freeCodeCamp-eba52b2d7a662d7c25740758f4646602a8ebc093c175093e424d02cd05033645","title":"","text":"], \"tests\": [ \"assert(code.match(/@each /g), 'message: Your code should use the @each directive.');\", \"assert($('blue-bg').css('background-color') == 'rgb(0, 0, 255)', 'message: Your .blue-bg class should have a background-color of blue.');\", \"assert($('black-bg').css('background-color') == 'rgb(0, 0, 0)', 'message: Your .black-bg class should have a background-color of black.');\", \"assert($('red-bg').css('background-color') == 'rgb(255, 0, 0)', 'message: Your .red-bg class should have a background-color of red.');\" \"assert($('.blue-bg').css('background-color') == 'rgb(0, 0, 255)', 'message: Your .blue-bg class should have a background-color of blue.');\", \"assert($('.black-bg').css('background-color') == 'rgb(0, 0, 0)', 'message: Your .black-bg class should have a background-color of black.');\", \"assert($('.red-bg').css('background-color') == 'rgb(255, 0, 0)', 'message: Your .red-bg class should have a background-color of red.');\" ], \"solutions\": [], \"hints\": [],"} +{"_id":"doc-en-freeCodeCamp-7b168b4ddc48fa04c0b6a4975f015edde19f07ffd3805097d2f97cc6e4039c75","title":"","text":"\"
let catStr = \"cat\";
let batStr = \"bat\";
let matStr = \"mat\";
let bgRegex = /[a-e]at/;
catStr.match(bgRegex); // Returns [\"cat\"]
batStr.match(bgRegex); // Returns [\"bat\"]
matStr.match(bgRegex); // Returns null
\", \"
\", \"Match all the letters in the string quoteSample.\", \"Note
Be sure to match both upper- and lowercase vowels.\"
\"Note
Be sure to match both upper- and lowercase letters.\"
], \"challengeSeed\": [ \"let quoteSample = \"The quick brown fox jumps over the lazy dog.\";\","} +{"_id":"doc-en-freeCodeCamp-af843584383383ff83a01f78e6f887dd90abe59717609e44daa4a0ddcfc7ece6","title":"","text":"import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { Button } from 'react-bootstrap'; import { updateMyProfileUI } from '../redux'; import { userSelector } from '../../../redux'; import { FullWidthRow } from '../../../helperComponents'; import { FullWidthRow, Spacer } from '../../../helperComponents'; import SectionHeader from './SectionHeader.jsx'; import ToggleSetting from './ToggleSetting.jsx'; const mapStateToProps = createSelector( userSelector, ({ profileUI = {} }) => ({ ...profileUI user => ({ ...user.profileUI, user }) );"} +{"_id":"doc-en-freeCodeCamp-a98d4ce92aa208678842545710071db28a1765945833926fb21fc114ef3f3edc","title":"","text":"showPoints: PropTypes.bool, showPortfolio: PropTypes.bool, showTimeLine: PropTypes.bool, updateMyProfileUI: PropTypes.func.isRequired updateMyProfileUI: PropTypes.func.isRequired, user: PropTypes.object }; function PrivacySettings(props) {"} +{"_id":"doc-en-freeCodeCamp-de67d52633926756586f647f9a0a42ad269899031cdf9d819b25790dd28ec20c","title":"","text":"showPoints, showPortfolio, showTimeLine, updateMyProfileUI updateMyProfileUI, user } = props; const toggleFlag = flag => () => updateMyProfileUI({ profileUI: { [flag]: !props[flag] } });"} +{"_id":"doc-en-freeCodeCamp-64b7012bd8506020828304f29a2617be3d24a0fb9a4cff6e27fc9fc7e87f2895","title":"","text":"Privacy Settings

The settings in this section enable you to control what is show on{' '} The settings in this section enable you to control what is shown on{' '} your freeCodeCamp public portfolio.

There is also a button to see what data we hold on your account

); }"} +{"_id":"doc-en-freeCodeCamp-ad3067a4713dc44a5a35fe7a9f937bf3efb5e4de7dded4027d3ad37e470b7eec","title":"","text":"\"contents\": [ \"// Example\", \"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];\", \"removedFromOurArray = ourArray.shift();\", \"var removedFromOurArray = ourArray.shift();\", \"// removedFromOurArray now equals \"Stimpson\" and ourArray now equals [\"J\", [\"cat\"]].\", \"\", \"// Setup\","} +{"_id":"doc-en-freeCodeCamp-3d349d81b0d23c2ef92ebc4d5c0e5f24c28859afd543470c5e5ee74fc43b2bb4","title":"","text":"} } ] } No newline at end of file } "} +{"_id":"doc-en-freeCodeCamp-57e9b0d81f3ce7c2dbd049e28318970fa19e2107a2672d7ef6d3dd0311d0806f","title":"","text":"if (user[certType]) { const { completedChallenges = [] } = user; const { completedDate = new Date() } = _.find(completedChallenges, ({ id }) => certId === id) || {}; const certChallenge = _.find( completedChallenges, ({ id }) => certId === id ); let { completedDate = new Date() } = certChallenge || {}; // the challange id has been rotated for isDataVisCert // so we need to check for id 561add10cb82ac38a17513b3 if (certType === 'isDataVisCert' && !certChallenge) { console.log('olderId'); let oldDataVisIdChall = _.find( completedChallenges, ({ id }) => '561add10cb82ac38a17513b3' === id ); if (oldDataVisIdChall) { completedDate = oldDataVisIdChall.completedDate || completedDate; } } const { username, name } = user; return res.json({"} +{"_id":"doc-en-freeCodeCamp-c6919301c55a22f2ac6b11f85218c80601acdef2632934106f5b479135f87fb8","title":"","text":"} pairedWith = pairedWith.pop(); //debug('This is paired with', Object.keys(pairedWith)); debug('This is paired with's uncompleted bonfires array', pairedWith.uncompletedBonfires); index = pairedWith.uncompletedBonfires.indexOf(bonfireHash); if (index > -1) { pairedWith.uncompletedBonfires.splice(index,1)"} +{"_id":"doc-en-freeCodeCamp-7b26248dd1198e946204c817fa907173486717eeb6950e10b3ec9cf683216438","title":"","text":"}; exports.returnNextBonfire = function(req, res, next) { // TODO //var tempUser = false; if (!req.user) { res.redirect('bonfires/meet-bonfire'); //tempUser = true; //req.user = new User(); return res.redirect('bonfires/meet-bonfire'); } var currentTime = parseInt(+new Date() / 1000) var currentTime = parseInt(+new Date() / 1000); if (currentTime - req.user.lastContentSync > 86400) { req.user.lastContentSync = currentTime; var completed = req.user.completedBonfires.map(function(elem) { var completed = req.user.completedBonfires.map(function (elem) { return elem._id; }); req.user.uncompletedBonfires = resources.allBonfireIds().filter(function(elem) { if (completed.indexOf(elem) === -1) { return elem; } req.user.uncompletedBonfires = resources.allBonfireIds().filter(function (elem) { if (completed.indexOf(elem) === -1) { return elem; } }); req.user.save(); }"} +{"_id":"doc-en-freeCodeCamp-920d206ec3793065050994c0d9022ccf42194b104bea904e073e9e0ef33cc0a2","title":"","text":"completedWith: null, title: bonfire[bonfireNumber].name, name: bonfire[bonfireNumber].name, difficulty: +bonfire[bonfireNumber].difficulty, difficulty: Math.floor(+bonfire[bonfireNumber].difficulty), brief: bonfire[bonfireNumber].description[0], details: bonfire[bonfireNumber].description.slice(1), tests: bonfire[bonfireNumber].tests,"} +{"_id":"doc-en-freeCodeCamp-ad4945d6d68cae6f023eca8d9727ccfa670235109b6a902706dfdffbf64e32c5","title":"","text":"res.render('bonfire/show', { completedWith: null, title: bonfireName, name: bonfireName, difficulty: +bonfireDifficulty, brief: bonfireDescription[0], details: bonfireDescription.slice(1),"} +{"_id":"doc-en-freeCodeCamp-885197a4a599a92b0f1b1be7974d89a22add22779d5aef65fc52ac154cff0c7e","title":"","text":"\"challengeEntryPoint\": \"meetBonfire(\"You can do this!\");\" }, { \"_id\": \"a202eed8fc186c8434cb6d61\", \"name\": \"Reverse a String\", \"difficulty\": \"1.01\", \"tests\": [ \"expect(reverseString('hello')).to.be.a('String');\", \"expect(reverseString('hello')).to.equal('olleh');\", \"expect(reverseString('Howdy')).to.equal('ydwoH');\", \"expect(reverseString('Greetings from Earth')).to.equal('htraE morf sgniteerG');\" ], \"description\": [ \"Reverse the provided string.\", \"You may need to turn the string into an array before you can reverse it.\", \"Your result must be a string.\" ], \"challengeEntryPoint\": \"reverseString('hello');\", \"challengeSeed\": \"function reverseString(str) {n return str;rn}\" }, { \"_id\": \"a302f7aae1aa3152a5b413bc\", \"name\": \"Factorialize a Number\", \"tests\": [ \"expect(factorialize(5)).to.be.a(\"Number\");\", \"expect(factorialize(5)).to.equal(120);\", \"expect(factorialize(10)).to.equal(3628800);\", \"expect(factorialize(20)).to.equal(2432902008176640000);\" ], \"difficulty\": \"1.02\", \"description\": [ \"Return the factorial of the provided integer.\", \"If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.\", \"Factorials are often represented with the shorthand notation n!\", \"For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f\" ], \"challengeSeed\": \"function factorialize(num) {n return num;rn}\", \"challengeEntryPoint\": \"factorialize(5);\" }, { \"_id\" : \"aaa48de84e1ecc7c742e1124\", \"name\": \"Check for Palindromes\", \"difficulty\": \"1\", \"difficulty\": \"1.03\", \"description\": [ \"Return 'true' if a given string is a palindrome.\", \"A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation and case.\","} +{"_id":"doc-en-freeCodeCamp-e0ff432154bc9a8a52669d5d2733f3c41686c27d3b7c1c5d7e29631ad8672c06","title":"","text":"\"challengeEntryPoint\": \"palindrome(\"eye\");\" }, { \"_id\": \"a26cbbe9ad8655a977e1ceb5\", \"name\": \"Find the Longest Word in a String\", \"difficulty\": \"1.04\", \"description\": [ \"Return the length of the longest word in the provided sentence.\", \"Your response should be a number.\" ], \"challengeEntryPoint\": \"findLongestWord('The quick brown fox jumped over the lazy dog');\", \"challengeSeed\": \"function findLongestWord(str) {n return str.length;rn}\", \"tests\": [ \"expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.be.a('Number');\", \"expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.equal(6);\", \"expect(findLongestWord('May the force be with you')).to.equal(5);\", \"expect(findLongestWord('Google do a barrel roll')).to.equal(6);\", \"expect(findLongestWord('What is the average airspeed velocity of an unladen swallow')).to.equal(8);\" ] }, { \"_id\": \"ab6137d4e35944e21037b769\", \"name\": \"Title Case a Sentence\", \"difficulty\": \"1.05\", \"description\": [ \"Return the provided string with the first letter of each word capitalized.\", \"For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.\" ], \"challengeEntryPoint\": \"titleCase(\"I'm a little tea pot\")\", \"challengeSeed\": \"function titleCase(str) {n return str;rn}\", \"tests\": [ \"expect(titleCase(\"I'm a little tea pot\")).to.be.a('String');\", \"expect(titleCase(\"I'm a little tea pot\")).to.equal(\"I'm A Little Tea Pot\");\", \"expect(titleCase(\"sHoRt AnD sToUt\")).to.equal(\"Short And Stout\");\", \"expect(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")).to.equal(\"Here Is My Handle Here Is My Spout\");\" ] }, { \"_id\": \"a789b3483989747d63b0e427\", \"name\": \"Return Largest Numbers in Arrays\", \"difficulty\": \"1.06\", \"description\": [ \"Return an array consisting of the largest numbers in the provided array. The array will contain 4 sub-arrays.\", \"Remember, you an iterate through an array with a simple for loop, and access each member with array syntax arr[i] .\", \"If you are writing your own Chai.js tests, be sure to use a deep equal statement instead of an equal statement when comparing arrays.\" ], \"challengeEntryPoint\": \"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);\", \"challengeSeed\": \"function largestOfFour(arr) {n // You can do this!rn return arr;rn}\", \"tests\": [ \"expect(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).to.be.a('array');\", \"(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.equals([5,27,39,1001]);\", \"assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) === [9,35,97,1000000]);\" ] }, { \"_id\": \"a3566b1109230028080c9345\", \"name\": \"Sum All Numbers in a Range\", \"difficulty\": \"2.00\", \"description\": [ \"We'll pass you an array of two numbers. Return the sum those two numbers and all numbers between them.\", \"The lowest number will not always come first.\" ], \"challengeEntryPoint\": \"sumAll([1, 4]);\", \"challengeSeed\": \"function sumAll(arr) {n return(1);rn}\", \"tests\": [ \"expect(sumAll([1, 4])).to.be.a('Number');\", \"expect(sumAll([1, 4])).to.equal(10);\", \"expect(sumAll([4, 1])).to.equal(10);\", \"expect(sumAll([5, 10])).to.equal(45);\", \"expect(sumAll([10, 5])).to.equal(45);\" ] }, { \"_id\": \"a5229172f011153519423690\", \"name\": \"Sum All Odd Fibonacci Numbers\", \"difficulty\": \"2.01\", \"description\": [ \"Return the sum of all odd fibonacci numbers up to and including the passed number.\", \"Starting from 1, the first few numbers of a Fibonacci sequence are 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.\" ], \"challengeEntryPoint\": \"sumFibs(1000);\", \"challengeSeed\": \"function sumFibs(num) {n return num;rn}\", \"tests\": [ \"expect(sumFibs(1)).to.be.a('number');\", \"expect(sumFibs(1000)).to.equal(3382);\", \"expect(sumFibs(4000000)).to.equal(10316619);\", \"expect(sumFibs(4)).to.equal(10);\" ] }, { \"_id\": \"a3bfc1673c0526e06d3ac698\", \"name\": \"Sum All Primes\", \"difficulty\": \"2.10\", \"description\": [ \"Sum all the prime numbers up to and including the provided number.\", \"A prime number is defined as having only two divisors, 1 and itself. For example, 2 is a prime number because it's only divisible by 1 and 2. 1 isn't a prime number, because it's only divisible by itself.\", \"The provided number may not be a prime.\" ], \"challengeEntryPoint\": \"sumPrimes(10);\", \"challengeSeed\": \"function sumPrimes(num) {n return num;rn}\", \"tests\": [ \"expect(sumPrimes(10)).to.be.a('number');\", \"expect(sumPrimes(10)).to.equal(27);\", \"expect(sumPrimes(977)).to.equal(73156);\" ] }, { \"_id\": \"ae9defd7acaf69703ab432ea\", \"name\": \"Smallest Common Multiple\", \"difficulty\": \"2.11\", \"description\": [ \"Find the smallest number that evenly divides all numbers in the provided range.\", \"The range will be an array of two numbers that will not necessarily be in numerical order.\" ], \"challengeEntryPoint\": \"smallestCommons([1,5]);\", \"challengeSeed\": \"function smallestCommons(arr) {n return arr;rn}rn\", \"tests\": [ \"expect(smallestCommons([1,5])).to.be.a('number');\", \"expect(smallestCommons([1,5])).to.equal(60);\", \"expect(smallestCommons([5,1])).to.equal(60);\", \"(smallestCommons([1,13])).should.equal(360360);\" ] }, { \"_id\" : \"aff0395860f5d3034dc0bfc9\", \"name\": \"Validate US Telephone Numbers\", \"difficulty\": \"3\", \"difficulty\": \"3.10\", \"description\": [ \"Return true if the passed string is a valid US phone number\", \"The user may fill out the form field any way they choose as long as it is a valid US number. The following are all valid formats for US numbers:\","} +{"_id":"doc-en-freeCodeCamp-ae3072ccaa80178b68afc6c13423cf513897f565d61909c41c0f3f8904177dc0","title":"","text":"\"challengeEntryPoint\": \"telephoneCheck(\"555-555-5555\");\" }, { \"_id\": \"a202eed8fc186c8434cb6d61\", \"name\": \"Reverse a String\", \"difficulty\": \"1\", \"tests\": [ \"expect(reverseString('hello')).to.be.a('String');\", \"expect(reverseString('hello')).to.equal('olleh');\", \"expect(reverseString('Howdy')).to.equal('ydwoH');\", \"expect(reverseString('Greetings from Earth')).to.equal('htraE morf sgniteerG');\" ], \"_id\": \"556138aff60341a09ed6c480\", \"name\": \"Inventory Update\", \"difficulty\": \"3.11\", \"description\": [ \"Reverse the provided string.\", \"You may need to turn the string into an array before you can reverse it.\", \"Your result must be a string.\" \"Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.\" ], \"challengeEntryPoint\": \"reverseString('hello');\", \"challengeSeed\": \"function reverseString(str) {n return str;rn}\" }, { \"_id\": \"a302f7aae1aa3152a5b413bc\", \"name\": \"Factorialize a Number\", \"challengeEntryPoint\": \"// Example inventory listsrnvar curInv = [rn [21, 'Bowling Ball'],rn [2, 'Dirty Sock'],rn [1, 'Hair pin'],rn [5, 'Microphone']rn];rnrnvar newInv = [rn [2, 'Hair Pin'],rn [3, 'Half-Eaten Apple'],rn [67, 'Bowling Ball'],rn [7, 'Toothpaste']rn];rnrninventory(curInv, newInv);\", \"challengeSeed\": \"function inventory(arr1, arr2) {n // All inventory must be accounted for or you're fired!rn return arr1;rn}\", \"tests\": [ \"expect(factorialize(5)).to.be.a(\"Number\");\", \"expect(factorialize(5)).to.equal(120);\", \"expect(factorialize(10)).to.equal(3628800);\", \"expect(factorialize(20)).to.equal(2432902008176640000);\" ], \"difficulty\": \"1\", \"description\": [ \"Return the factorial of the provided integer.\", \"If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.\", \"Factorials are often represented with the shorthand notation n!\", \"For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f\" ], \"challengeSeed\": \"function factorialize(num) {n return num;rn}\", \"challengeEntryPoint\": \"factorialize(5);\" }, { \"_id\": \"a26cbbe9ad8655a977e1ceb5\", \"name\": \"Find the Longest Word in a String\", \"difficulty\": \"1\", \"description\": [ \"Return the length of the longest word in the provided sentence.\", \"Your response should be a number.\" ], \"challengeEntryPoint\": \"findLongestWord('The quick brown fox jumped over the lazy dog');\", \"challengeSeed\": \"function findLongestWord(str) {n return str.length;rn}\", \"tests\": [ \"expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.be.a('Number');\", \"expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.equal(6);\", \"expect(findLongestWord('May the force be with you')).to.equal(5);\", \"expect(findLongestWord('Google do a barrel roll')).to.equal(6);\", \"expect(findLongestWord('What is the average airspeed velocity of an unladen swallow')).to.equal(8);\" ] }, { \"_id\": \"a3566b1109230028080c9345\", \"name\": \"Sum All Numbers in a Range\", \"difficulty\": \"2\", \"description\": [ \"We'll pass you an array of two numbers. Return the sum those two numbers and all numbers between them.\", \"The lowest number will not always come first.\" ], \"challengeEntryPoint\": \"sumAll([1, 4]);\", \"challengeSeed\": \"function sumAll(arr) {n return(1);rn}\", \"tests\": [ \"expect(sumAll([1, 4])).to.be.a('Number');\", \"expect(sumAll([1, 4])).to.equal(10);\", \"expect(sumAll([4, 1])).to.equal(10);\", \"expect(sumAll([5, 10])).to.equal(45);\", \"expect(sumAll([10, 5])).to.equal(45);\" ] }, { \"_id\": \"ab6137d4e35944e21037b769\", \"name\": \"Title Case a Sentence\", \"difficulty\": \"1\", \"description\": [ \"Return the provided string with the first letter of each word capitalized.\", \"For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.\" ], \"challengeEntryPoint\": \"titleCase(\"I'm a little tea pot\")\", \"challengeSeed\": \"function titleCase(str) {n return str;rn}\", \"tests\": [ \"expect(titleCase(\"I'm a little tea pot\")).to.be.a('String');\", \"expect(titleCase(\"I'm a little tea pot\")).to.equal(\"I'm A Little Tea Pot\");\", \"expect(titleCase(\"sHoRt AnD sToUt\")).to.equal(\"Short And Stout\");\", \"expect(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")).to.equal(\"Here Is My Handle Here Is My Spout\");\" \"expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');\", \"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);\", \"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);\", \"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair pin'], [5, 'Microphone']]);\", \"assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]);\", \"assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [1, 'Dirty Sock'], [1, 'Hair pin'], [1, 'Half-Eaten Apple'], [1, 'Microphone'], [1, 'Toothpaste']]);\" ] } ]"} +{"_id":"doc-en-freeCodeCamp-209cd44829d3cfae62952ad5ec6ea7bb1b09ea1d7cc8d1847885f8d44f9001d8","title":"","text":".form-group label.col-sm-2.control-label.wrappable(for='description') description: .col-sm-10 textarea#description.form-control(name=\"description\", placeholder=\"Separate sentences by exactly one space only. Do not add in line breaks.\") textarea#description.form-control(name=\"description\", rows=5, placeholder=\"Separate sentences by exactly one space only. Do not add in line breaks.\") .form-group label.col-sm-2.control-label.wrappable(for='challengeSeed') challengeSeed: .col-sm-10"} +{"_id":"doc-en-freeCodeCamp-69c2dbf179a1f99bb11b443fd6260cad7423ebc7a4bb40f4fbe89d1f5adf7625","title":"","text":"## Description
In Computer Science a queue is an abstract Data Structure where items are kept in order. New items can be added at the back of the queue and old items are taken off from the front of the queue. In Computer Science a queue is an abstract Data Structure where items are kept in order. New items can be added at the back of the queue and old items are taken off from the front of the queue. Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of the array. The nextInLine function should then return the element that was removed."} +{"_id":"doc-en-freeCodeCamp-8debe593129d8d102410e566082249b58f6918baac69ded84fe793118e904b96","title":"","text":"User Story #4: When I enter GitHub flavored markdown into the #editor element, the text is rendered as HTML in the #preview element as I type (HINT: You don't need to parse Markdown yourself - you can import the Marked library for this: https://cdnjs.com/libraries/marked). User Story #5: When my markdown previewer first loads, the default text in the #editor field should contain valid markdown that represents at least one of each of the following elements: a header (H1 size), a sub header (H2 size), a link, inline code, a code block, a list item, a blockquote, an image, and bolded text. User Story #6: When my markdown previewer first loads, the default markdown in the #editor field should be rendered as HTML in the #preview element. Optional Bonus (you do not need to make this test pass): When I click a link rendered by my markdown previewer, the link is opened up in a new tab (HINT: read the Marked.js docs for this one!). Optional Bonus (you do not need to make this test pass): My markdown previewer interprets carriage returns and renders them as br (line break) elements. You can build your project by forking this CodePen pen. Or you can use this CDN link to run the tests in any environment you like: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js Once you're done, submit the URL to your working project with all its tests passing."} +{"_id":"doc-en-freeCodeCamp-5e319515b5e237da32789e4bed9ab54cfe9c4e78d26a0ed6e616e270f64aa34c","title":"","text":" `, { runScripts: 'dangerously', virtualConsole virtualConsole, url: 'http://localhost' }); const { window } = dom;"} +{"_id":"doc-en-freeCodeCamp-c459bd8b6c9b33bd444380b33f01600bb12e4d78e68bc9e129786cbd47b29cf2","title":"","text":"```yml tests: - text: Traditional function expression should not be used. testString: getUserInput => assert(!getUserInput('index').match(/function/)); testString: getUserInput => assert(!removeJSComments(code).match(/function/)); - text: setGear should be a declarative function. testString: getUserInput => assert(typeof bicycle.setGear === 'function' && getUserInput('index').match(/setGears*(.+)s*{/)); testString: assert(typeof bicycle.setGear === 'function' && code.match(/setGears*(.+)s*{/)); - text: bicycle.setGear(48) should change the gear value to 48. testString: assert((new bicycle.setGear(48)).gear === 48);"} +{"_id":"doc-en-freeCodeCamp-ecf821fc66b4489278b25ac24b5709cd332b504da29fab32f804a28521987b19","title":"","text":" ### After Test
```js const removeJSComments = str => str.replace(//*[sS]*?*/|//.*$/gm, ''); ```
## Solution"} +{"_id":"doc-en-freeCodeCamp-e4495ec20d4bce0625b5edfd3f6a66f3a42a5cd9b5ad4f77cc409d247a04e382","title":"","text":"## ![:rotating_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/rotating_light.png?v=3 \":rotating_light:\") Intermediate Code Solution: ```javascript rating = watchList.map( (item) => ({\"title\":item[\"Title\"], \"rating\":item[\"imdbRating\"]}) ); const rating = watchList.map(item => ({title: item[\"Title\"], rating: item[\"imdbRating\"]})); ``` ### Code Explanation: Using ES6 notation, each item in array is processed to extract title and rating."} +{"_id":"doc-en-freeCodeCamp-6ede35176b133bed5548bc2c54e5ba82c0fe01faad083ac5ab39f33c6f7eda33","title":"","text":"id: 587d778b367417b2b2512aa8 title: Add an Accessible Date Picker challengeType: 0 videoUrl: 'https://scrimba.com/c/cD9DJHr' videoUrl: 'https://scrimba.com/c/cR3bRbCV' --- ## Description"} +{"_id":"doc-en-freeCodeCamp-cff4b3531ea755cde5d7edd336795ed4235e9213ffa170cd165544641c22d97c","title":"","text":"id: 587d778d367417b2b2512aaa title: Make Elements Only Visible to a Screen Reader by Using Custom CSS challengeType: 0 videoUrl: 'https://scrimba.com/c/c8azdfM' videoUrl: 'https://scrimba.com/c/cJ8QGkhJ' --- ## Description"} +{"_id":"doc-en-freeCodeCamp-ea6c1ef79edae71498aa3a7a3173126d12499973580ec22131d66c4dbe79a1fb","title":"","text":"import DonateModal from '../Donation'; import 'prismjs/themes/prism.css'; import './prism.css'; import './prism-night.css'; import 'react-reflex/styles.css'; import './learn.css';"} +{"_id":"doc-en-freeCodeCamp-4e56bb6832d49069e15e5909a2fde69cdb8d140db7f58d157fb7660dee521b99","title":"","text":" /** * 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; } "} +{"_id":"doc-en-freeCodeCamp-af1a927d1cb777360644472e238a0b9e13cee901b7fe92db853834b4b819eca4","title":"","text":" import React, { Fragment } from 'react'; import React, { Fragment, Component } from 'react'; import Prism from 'prismjs'; import PropTypes from 'prop-types'; import './challenge-description.css';"} +{"_id":"doc-en-freeCodeCamp-0b8f3fc43f3286edd2ecdd6cacc386996971a3af6d9e93e2e26c17a42e96b134","title":"","text":"section: PropTypes.string }; function ChallengeDescription({ description, instructions, section }) { return (
{instructions && (
)}
); 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 (
{instructions && (
)}
); } } ChallengeDescription.displayName = 'ChallengeDescription';"} +{"_id":"doc-en-freeCodeCamp-83871e88d50541743c0cafe6ca44f791e342ffca0501a6217680e927b0286584","title":"","text":"## Description
To create a CSS Variable, you just need to give it a name with two dashes in front of it and assign it a value like this: To create a CSS variable, you just need to give it a name with two dashes in front of it and assign it a value like this: ```css --penguin-skin: gray;"} +{"_id":"doc-en-freeCodeCamp-24578eceb7ec6bf18b1b975a44a02c75ab5879f66a4ae804a5ed4035e14457fa","title":"","text":"## Instructions
In the penguin class, create a variable name --penguin-skin and give it a value of gray In the penguin class, create a variable name --penguin-skin and give it a value of gray.
## Tests"} +{"_id":"doc-en-freeCodeCamp-e13dfe673314cd3b80e2e0af98050695c3ebe02141e98a7f026a4c14c5cb61b1","title":"","text":"--- title: Caesars Cipher --- ![:triangular_flag_on_post:](https://forum.freecodecamp.com/images/emoji/emoji_one/triangular_flag_on_post.png?v=3 \":triangular_flag_on_post:\") Remember to use **`Read-Search-Ask`** if you get stuck. Try to pair program ![:busts_in_silhouette:](https://forum.freecodecamp.com/images/emoji/emoji_one/busts_in_silhouette.png?v=3 \":busts_in_silhouette:\") and write your own code ![:pencil:](https://forum.freecodecamp.com/images/emoji/emoji_one/pencil.png?v=3 \":pencil:\") ### ![:checkered_flag:](https://forum.freecodecamp.com/images/emoji/emoji_one/checkered_flag.png?v=3 \":checkered_flag:\") Problem Explanation: * You need to write a function, which will take a string encoded with _Caesar cipher_ as a parameter and decode it. * The one used here is ROT13 where the value of the letter is shifted by 13 places. e.g. 'A' ![:left_right_arrow:](https://forum.freecodecamp.com/images/emoji/emoji_one/left_right_arrow.png?v=3 \":left_right_arrow:\") 'N', 'T' ![:left_right_arrow:](https://forum.freecodecamp.com/images/emoji/emoji_one/left_right_arrow.png?v=3 \":left_right_arrow:\") 'G'. * You have to shift it back 13 positions, such that 'N' ![:left_right_arrow:](https://forum.freecodecamp.com/images/emoji/emoji_one/left_right_arrow.png?v=3 \":left_right_arrow:\") 'A'. #### Relevant Links * String.prototype.charCodeAt * String.fromCharCode ## ![:speech_balloon:](https://forum.freecodecamp.com/images/emoji/emoji_one/speech_balloon.png?v=3 \":speech_balloon:\") Hint: 1"} +{"_id":"doc-en-freeCodeCamp-6794ef8d3965dadce84a6bd66ab65cc8ea2af6440d23816c0f7f0667bdf660ef","title":"","text":"## ![:beginner:](https://forum.freecodecamp.com/images/emoji/emoji_one/beginner.png?v=3 \":beginner:\") Basic Code Solution: ```javascript function rot13(str) { // Split str into a character array return str.split('') // Iterate over each character in the array .map.call(str, function(char) { // Convert char to a character code x = char.charCodeAt(0); // Checks if character lies between A-Z if (x < 65 || x > 90) { return String.fromCharCode(x); // Return un-converted character } //N = ASCII 78, if the character code is less than 78, shift forward 13 places else if (x < 78) { return String.fromCharCode(x + 13); } // Otherwise shift the character 13 places backward return String.fromCharCode(x - 13); }).join(''); // Rejoin the array into a string } function rot13(str) { // Split str into a character array return str.split('') // Iterate over each character in the array .map.call(str, function(char) { // Convert char to a character code var x = char.charCodeAt(0); // Checks if character lies between A-Z if (x < 65 || x > 90) { return String.fromCharCode(x); // Return un-converted character } //N = ASCII 78, if the character code is less than 78, shift forward 13 places else if (x < 78) { return String.fromCharCode(x + 13); } // Otherwise shift the character 13 places backward return String.fromCharCode(x - 13); }).join(''); // Rejoin the array into a string } ``` ![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 \":rocket:\") Run Code ### Code Explanation:"} +{"_id":"doc-en-freeCodeCamp-7bc431c7f256392184273ca6921c12e2fd8572b3b8bb25c5dfaf10bd446b7c0e","title":"","text":"#### Relevant Links * Array.prototype.map * String.prototype.split * Array.prototype.join * Array.prototype.map * String.prototype.split * Array.prototype.join ## ![:sunflower:](https://forum.freecodecamp.com/images/emoji/emoji_one/sunflower.png?v=3 \":sunflower:\") Intermediate Code Solution: ```javascript // Solution with Regular expression and Array of ASCII character codes function rot13(str) { var rotCharArray = []; var regEx = /[A-Z]/ ; str = str.split(\"\"); for (var x in str) { if (regEx.test(str[x])) { // A more general approach // possible because of modular arithmetic // and cyclic nature of rot13 transform rotCharArray.push((str[x].charCodeAt() - 65 + 13) % 26 + 65); } else { rotCharArray.push(str[x].charCodeAt()); } } str = String.fromCharCode.apply(String, rotCharArray); return str; // Solution with Regular expression and Array of ASCII character codes function rot13(str) { var rotCharArray = []; var regEx = /[A-Z]/; str = str.split(\"\"); for (var x in str) { if (regEx.test(str[x])) { // A more general approach // possible because of modular arithmetic // and cyclic nature of rot13 transform rotCharArray.push((str[x].charCodeAt() - 65 + 13) % 26 + 65); } else { rotCharArray.push(str[x].charCodeAt()); } } str = String.fromCharCode.apply(String, rotCharArray); return str; } // Change the inputs below to test rot13(\"LBH QVQ VG!\"); // Change the inputs below to test rot13(\"LBH QVQ VG!\"); ``` ### Code Explanation:"} +{"_id":"doc-en-freeCodeCamp-3cd93049a179b119cd457eeaf973f312b0d0963c6619d5658409acc4375e8ec4","title":"","text":"* Regex * Regex.test ![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 \":rocket:\") Run Code ## ![:rotating_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/rotating_light.png?v=3 \":rotating_light:\") Advanced Code Solution: function rot13(str) { // LBH QVQ VG!"} +{"_id":"doc-en-freeCodeCamp-a1aae7853be3d912499590f1ebc0e7271c33402a3b90cbf4324b45fa1180585c","title":"","text":"} .challenge-title-wrap > a { margin-top: 10px; align-self: flex-start; }"} +{"_id":"doc-en-freeCodeCamp-6ff5ab9e4111a57637f644701247257b0e25e33072c43520315cbd7b15955ee8","title":"","text":"#supporter-progress-wrapper .progress { height: 38px; margin-bottom: 0px; background-color: var(--quaternary-background); } #supporter-progress-wrapper .progress-bar { padding-top: 8px; background-color: var(--secondary-color); }"} +{"_id":"doc-en-freeCodeCamp-19e78c8e9a17ddf9a3868b39fe29d0a793f61ad5a0aeff57a4c3b6b215e97dee","title":"","text":"const mapStateToProps = createSelector( userSelector, ({ theme = 'default' }) => ({ theme }) ({ theme = 'night' }) => ({ theme }) ); const mapDispatchToProps = dispatch =>"} +{"_id":"doc-en-freeCodeCamp-4a855e3c07a70d7cce85969890307a5d8f51ed7f631de7ecc2b111e9215ea182","title":"","text":".map-challenge-title { margin-bottom: 0.25rem; max-width: 28rem; max-width: calc(100% - 80px); } .block a {"} +{"_id":"doc-en-freeCodeCamp-77e8a4de2f47d574bf79c7adda3b49db443ed5b4778023a2a0585daa4ffd03b6","title":"","text":"if (this.state.downloadURL) { URL.revokeObjectURL(this.state.downloadURL); } this.props.close(); } render() {"} +{"_id":"doc-en-freeCodeCamp-c4b99870533c84a92af3ec991ce4d088f191d41b7c6cc50b77d64c2609afef11","title":"","text":"}; this._editor = null; this.focusOnEditor = this.focusOnEditor.bind(this); } editorWillMount = monaco => {"} +{"_id":"doc-en-freeCodeCamp-6f8c9d014df3f93aa04d1d8c6f156a0cce36944ed5ca31b7f9d87998ab6fb899","title":"","text":"} } focusOnEditor() { this._editor.focus(); } onChange = editorValue => { const { updateFile, fileKey } = this.props; updateFile({ key: fileKey, editorValue });"} +{"_id":"doc-en-freeCodeCamp-9853f84866eb2ba8b031d87436f3a62045bf393730bdaea843ee94b4bbbb4a14","title":"","text":"Editor.displayName = 'Editor'; Editor.propTypes = propTypes; // NOTE: withRef gets replaced by forwardRef in react-redux 6, // https://github.com/reduxjs/react-redux/releases/tag/v6.0.0 export default connect( mapStateToProps, mapDispatchToProps mapDispatchToProps, null, { withRef: true } )(Editor);"} +{"_id":"doc-en-freeCodeCamp-ae59debef22dc0e60df22045c2d8bcc6370e597aff2f2bca504a1539cb0b9a23","title":"","text":"}; this.containerRef = React.createRef(); this.editorRef = React.createRef(); } onResize() { this.setState({ resizing: true });"} +{"_id":"doc-en-freeCodeCamp-9a0b7a65d9f8ab83d19d1271c926c80adaf2b03d4c22d8cd163fd2e1d6311c3f","title":"","text":"challengeFile && ( ref={this.editorRef} {...challengeFile} fileKey={challengeFile.key} />"} +{"_id":"doc-en-freeCodeCamp-3bcdb5aa93cc8dfb9654d4775a542f35d4bef606a83bbcaec69b48a400b1aa59","title":"","text":"} = this.props; return ( editorRef={this.editorRef} executeChallenge={executeChallenge} innerRef={this.containerRef} introPath={introPath}"} +{"_id":"doc-en-freeCodeCamp-e6509666bf197d45f14e9e996007f43e72770e6da56fa12e682e4fde437c4b4e","title":"","text":"const keyMap = { NAVIGATION_MODE: 'escape', EXECUTE_CHALLENGE: ['ctrl+enter', 'command+enter'], FOCUS_EDITOR: 'e', NAVIGATE_PREV: ['p'], NAVIGATE_NEXT: ['n'] };"} +{"_id":"doc-en-freeCodeCamp-0d53c2b93b86e82ad6f8e058af05ae9dd2b24205ecf304b24fbc80c81667979e","title":"","text":"const propTypes = { canFocusEditor: PropTypes.bool, children: PropTypes.any, editorRef: PropTypes.object, executeChallenge: PropTypes.func, innerRef: PropTypes.any, introPath: PropTypes.string,"} +{"_id":"doc-en-freeCodeCamp-7fbe1712d4107e79c1ea2a3de494a4b91d8db96f471b9d2a37b54b5fbe50e37f","title":"","text":"function Hotkeys({ canFocusEditor, children, editorRef, executeChallenge, introPath, innerRef,"} +{"_id":"doc-en-freeCodeCamp-f099c8f2a1929360775ba86f7939f27b78086dfd0320ee6239d8d8bdf0750f13","title":"","text":"e.preventDefault(); if (executeChallenge) executeChallenge(); }, FOCUS_EDITOR: e => { e.preventDefault(); if (editorRef && editorRef.current) { editorRef.current.getWrappedInstance().focusOnEditor(); } }, NAVIGATION_MODE: () => setEditorFocusability(false), NAVIGATE_PREV: () => { if (!canFocusEditor) navigate(prevChallengePath);"} +{"_id":"doc-en-freeCodeCamp-61524963d9213b1ac39671c6491473321f23ef9c438aceae9eebc88ff2c4e764","title":"","text":"} .form-control { color: var(--theme-color); color: var(--primary-color); outline: none; border-color: var(--quaternary-background); background-color: var(--primary-background); -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important;"} +{"_id":"doc-en-freeCodeCamp-ebc2cefadeb3e2485ad013a8b45157de8e20317310ec01ba8eabbed94c5b83b1","title":"","text":"} } function replacer(key, value) { if (Number.isNaN(value)) { return 'NaN'; } return value; } const oldLog = self.console.log.bind(self.console); self.console.log = function proxyConsole(...args) { logs.push(args.map(arg => '' + JSON.stringify(arg)).join(' ')); logs.push(args.map(arg => '' + JSON.stringify(arg, replacer)).join(' ')); if (logs.join('n').length > MAX_LOGS_SIZE) { flushLogs(); }"} +{"_id":"doc-en-freeCodeCamp-016e6360b384f8e90f19bafca8726558fb093e239369c8c2c46a5ee99d7a7bfe","title":"","text":"- text: Your code should use the filter method. testString: assert(code.match(/.filter/g)); - text: Your code should not use a for loop. testString: assert(!code.match(/fors*?(.+?)/g)); testString: assert(!code.match(/fors*?([sS]*?)/g)); - text: 'filteredList should equal [{\"title\": \"Inception\",\"rating\": \"8.8\"},{\"title\": \"Interstellar\",\"rating\": \"8.6\"},{\"title\": \"The Dark Knight\",\"rating\": \"9.0\"},{\"title\": \"Batman Begins\",\"rating\": \"8.3\"}].' testString: 'assert.deepEqual(filteredList, [{\"title\": \"Inception\",\"rating\": \"8.8\"},{\"title\": \"Interstellar\",\"rating\": \"8.6\"},{\"title\": \"The Dark Knight\",\"rating\": \"9.0\"},{\"title\": \"Batman Begins\",\"rating\": \"8.3\"}]);'"} +{"_id":"doc-en-freeCodeCamp-34d04b4a19692bd73757c090f6854311e4f5fd801c93e43983b1e55c48131030","title":"","text":"- text: The watchList variable should not change. testString: assert(watchList[0].Title === \"Inception\" && watchList[4].Director == \"James Cameron\"); - text: Your code should not use a for loop. testString: assert(!removeJSComments(code).match(/fors*?(.*?)/)); testString: assert(!removeJSComments(code).match(/fors*?([sS]*?)/)); - text: Your code should use the map method. testString: assert(code.match(/.map/g)); - text: ratings should equal [{\"title\":\"Inception\",\"rating\":\"8.8\"},{\"title\":\"Interstellar\",\"rating\":\"8.6\"},{\"title\":\"The Dark Knight\",\"rating\":\"9.0\"},{\"title\":\"Batman Begins\",\"rating\":\"8.3\"},{\"title\":\"Avatar\",\"rating\":\"7.9\"}]."} +{"_id":"doc-en-freeCodeCamp-8404d26cb669569e05aa3521e68262aa64146e7d7a5e56b5a3b0c2f6b054541f","title":"","text":"- text: The getRating(watchList) should equal 8.675. testString: assert(getRating(watchList) === 8.675); - text: Your code should not use a for loop. testString: assert(!code.match(/fors*?(.*)/g)); testString: assert(!code.match(/fors*?([sS]*?)/g)); - text: Your code should return correct output after modifying the watchList object. testString: assert(getRating(watchList.filter((_, i) => i < 1 || i > 2)) === 8.55);"} +{"_id":"doc-en-freeCodeCamp-bf30abd3a92170db477751da2d4c21998d81833df5c7ee6b84c97558941a3b20","title":"","text":"A strategy is a way of authenticating a user. You can use a strategy for allowing users to authenticate based on locally saved information (if you have them register first) or from a variety of providers such as Google or GitHub. For this project, we will set up a local strategy. To see a list of the hundreds of strategies, visit Passport's site [here](http://passportjs.org/). Add `passport-local` as a dependency and add it to your server as follows: `const LocalStrategy = require('passport-local');` Add `passport-local@~1.0.0` as a dependency and add it to your server as follows: `const LocalStrategy = require('passport-local');` Now you will have to tell passport to **use** an instantiated LocalStrategy object with a few settings defined. Make sure this (as well as everything from this point on) is encapsulated in the database connection since it relies on it!"} +{"_id":"doc-en-freeCodeCamp-3627faa088d1aa0b0772fb800ec89f0bbc55df7b9b4c058b6b6069f44df06c23","title":"","text":"Currently, you cannot determine who is connected to your web socket. While `req.user` contains the user object, that's only when your user interacts with the web server, and with web sockets you have no `req` (request) and therefore no user data. One way to solve the problem of knowing who is connected to your web socket is by parsing and decoding the cookie that contains the passport session then deserializing it to obtain the user object. Luckily, there is a package on NPM just for this that turns a once complex task into something simple! Add `passport.socketio`, `connect-mongo@~3.2.0`, and `cookie-parser` as dependencies and require them as `passportSocketIo`, `MongoStore`, and `cookieParser` respectively. Also, we need to initialize a new memory store, from `express-session` which we previously required. It should look like this: Add `passport.socketio@~3.7.0`, `connect-mongo@~3.2.0`, and `cookie-parser@~1.4.5` as dependencies and require them as `passportSocketIo`, `MongoStore`, and `cookieParser` respectively. Also, we need to initialize a new memory store, from `express-session` which we previously required. It should look like this: ```js const MongoStore = require('connect-mongo')(session);"} +{"_id":"doc-en-freeCodeCamp-b2bf78327ea8c47b1cca7a33b7d8de600c4fc2356ede5902ca4d5b2cd635be3e","title":"","text":"Going back to the information security section, you may remember that storing plaintext passwords is *never* okay. Now it is time to implement BCrypt to solve this issue. Add BCrypt as a dependency, and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account, and when you check to see that a password is correct on login. Add `bcrypt@~5.0.0` as a dependency, and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account, and when you check to see that a password is correct on login. Currently on our registration route, you insert a user's password into the database like so: `password: req.body.password`. An easy way to implement saving a hash instead is to add the following before your database logic `const hash = bcrypt.hashSync(req.body.password, 12);`, and replacing the `req.body.password` in the database saving with just `password: hash`."} +{"_id":"doc-en-freeCodeCamp-b5bb85724beee3e46008853e2dc158c6ba7a85dcceb0530e9248e398d11a1bd7","title":"","text":"# --description-- The last part of setting up your GitHub authentication is to create the strategy itself. For this, you will need to add the dependency of 'passport-github' to your project and require it in your `auth.js` as `GithubStrategy` like this: `const GitHubStrategy = require('passport-github').Strategy;`. Do not forget to require and configure `dotenv` to use your environment variables. The last part of setting up your GitHub authentication is to create the strategy itself. For this, you will need to add the dependency of `passport-github@~1.1.0` to your project and require it in your `auth.js` as `GithubStrategy` like this: `const GitHubStrategy = require('passport-github').Strategy;`. Do not forget to require and configure `dotenv` to use your environment variables. To set up the GitHub strategy, you have to tell Passport to use an instantiated `GitHubStrategy`, which accepts 2 arguments: an object (containing `clientID`, `clientSecret`, and `callbackURL`) and a function to be called when a user is successfully authenticated, which will determine if the user is new and what fields to save initially in the user's database object. This is common across many strategies, but some may require more information as outlined in that specific strategy's GitHub README. For example, Google requires a *scope* as well which determines what kind of information your request is asking to be returned and asks the user to approve such access. The current strategy we are implementing has its usage outlined [here](https://github.com/jaredhanson/passport-github/), but we're going through it all right here on freeCodeCamp!"} +{"_id":"doc-en-freeCodeCamp-7b4bdb86ca72fbdbd0df440aa99527ee15ad69fc0599ea439103c18f6f50690a","title":"","text":"To set this up properly, we need to have a serialize function and a deserialize function. In Passport, we create these with `passport.serializeUser( OURFUNCTION )` and `passport.deserializeUser( OURFUNCTION )` The `serializeUser` is called with 2 arguments, the full user object and a callback used by passport. A unique key to identify that user should be returned in the callback, the easiest one to use being the user's `_id` in the object. It should be unique as it generated by MongoDB. Similarly, `deserializeUser` is called with that key and a callback function for passport as well, but, this time, we have to take that key and return the full user object to the callback. To make a query search for a Mongo `_id`, you will have to create `const ObjectID = require('mongodb').ObjectID;`, and then to use it you call `new ObjectID(THE_ID)`. Be sure to add MongoDB as a dependency. You can see this in the examples below: The `serializeUser` is called with 2 arguments, the full user object and a callback used by passport. A unique key to identify that user should be returned in the callback, the easiest one to use being the user's `_id` in the object. It should be unique as it generated by MongoDB. Similarly, `deserializeUser` is called with that key and a callback function for passport as well, but, this time, we have to take that key and return the full user object to the callback. To make a query search for a Mongo `_id`, you will have to create `const ObjectID = require('mongodb').ObjectID;`, and then to use it you call `new ObjectID(THE_ID)`. Be sure to add `mongodb@~3.6.0` as a dependency. You can see this in the examples below: ```js passport.serializeUser((user, done) => {"} +{"_id":"doc-en-freeCodeCamp-eb4b12f25701162b8e08d49b6ba83e5af25a53d8103a1c235b997cbed55f6077","title":"","text":"It's time to set up *Passport* so we can finally start allowing a user to register or login to an account! In addition to Passport, we will use Express-session to handle sessions. Using this middleware saves the session id as a cookie in the client and allows us to access the session data using that id on the server. This way we keep personal account information out of the cookie used by the client to verify to our server they are authenticated and just keep the *key* to access the data stored on the server. To set up Passport for use in your project, you will need to add it as a dependency first in your package.json. `\"passport\": \"^0.3.2\"` To set up Passport for use in your project, you will need to add it as a dependency first in your package.json. `passport@~0.4.1` In addition, add Express-session as a dependency now as well. Express-session has a ton of advanced features you can use but for now we're just going to use the basics! `\"express-session\": \"^1.15.0\"` In addition, add Express-session as a dependency now as well. Express-session has a ton of advanced features you can use but for now we're just going to use the basics! `express-session@~1.17.1` You will need to set up the session settings now and initialize Passport. Be sure to first create the variables 'session' and 'passport' to require 'express-session' and 'passport' respectively."} +{"_id":"doc-en-freeCodeCamp-1899a60af6fa80e6057f5d8ca3ead84867d3ba793888ea59918cb4d9de00396a","title":"","text":"The following challenges will make use of the `chat.pug` file. So, in your `routes.js` file, add a GET route pointing to `/chat` which makes use of `ensureAuthenticated`, and renders `chat.pug`, with `{ user: req.user }` passed as an argument to the response. Now, alter your existing `/auth/github/callback` route to set the `req.session.user_id = req.user.id`, and redirect to `/chat`. Add `http` and `socket.io` as a dependency and require/instantiate them in your server defined as follows: Add `socket.io@~2.3.0` as a dependency and require/instantiate it in your server defined as follows, with `http` (comes built-in with Nodejs): ```javascript const http = require('http').createServer(app);"} +{"_id":"doc-en-freeCodeCamp-e4ed96661be3312397ffa1f201f117efccb84db7cd3cec1b5164ac2c861ac3d7","title":"","text":"```js // doubles input value and returns it const doubler = (item) => item * 2; doubler(4); // returns 8 ``` If an arrow function has a single argument, the parentheses enclosing the argument may be omitted. If an arrow function has a single parameter, the parentheses enclosing the parameter may be omitted. ```js // the same function, without the argument parentheses // the same function, without the parameter parentheses const doubler = item => item * 2; ```"} +{"_id":"doc-en-freeCodeCamp-422b7b731c2be16583751f2552d7f005f207bf536410ecebf4d827b2faa2184c","title":"","text":"```js // multiplies the first input value by the second and returns it const multiplier = (item, multi) => item * multi; multiplier(4, 2); // returns 8 ```
"} +{"_id":"doc-en-freeCodeCamp-3886625a88dad0216fc207bebd5bb57f0a9d19bb826c72b5500b825aef05a2fe","title":"","text":"run: npm run seed - name: Cypress run uses: cypress-io/github-action@v1 uses: cypress-io/github-action@v2 with: record: ${{ env.CYPRESS_RECORD_KEY != 0 }} build: npm run build"} +{"_id":"doc-en-freeCodeCamp-f2c237e5455fcc8b7c437b4594c3e7fc8060bd0478b00bddcf1191e6b233e6cf","title":"","text":"}; ``` If `value` submitted to `/api/check` is already placed in `puzzle` on that `coordinate`, the returned value will be an object containing a `valid` property with `true` if `value` is not conflicting. ```js async (getUserInput) => { const input = '..9..5.1.85.4....2432......1...69.83.9.....6.62.71...9......1945....4.37.4.3..6..'; const coordinate = 'C3'; const value = '2'; const data = await fetch(getUserInput('url') + '/api/check', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ puzzle: input, coordinate, value }) }); const parsed = await data.json(); assert.property(parsed, 'valid'); assert.isTrue(parsed.valid); }; ``` If the puzzle submitted to `/api/check` contains values which are not numbers or periods, the returned value will be `{ error: 'Invalid characters in puzzle' }` ```js"} +{"_id":"doc-en-freeCodeCamp-329bfee8602fd18c5d1cd9f489ba54001369915817f3a8a9c572d194a2bdb531","title":"","text":"# --instructions-- Create a function that returns the $ n^{th} $ member of the sequence using the method outlined above. Create a function that returns the position in the Stern-Brocot sequence at which $ n $ is first encountered, where the sequence is generated with the method outlined above. Note that this sequence uses 1 based indexing. # --hints--"} +{"_id":"doc-en-freeCodeCamp-4e192e57988ec297983d0a4f32ac6f7961c1e668bce8aa7ef56ba533bcc35427","title":"","text":"let textMessage = dedent( `**Tell us what's happening:** Describe your issue in detail here. ${ projectFormValues.length"} +{"_id":"doc-en-freeCodeCamp-f5da65b7b698c03cf08d7211028b40a1f8de435001943985940af7aad6fe28f2","title":"","text":"# --instructions-- Create a second `p` element after the existing `p` element with the following kitty ipsum text: `Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.` Create a second `p` element with the following kitty ipsum text: `Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.` Then, create a `main` element and nest the two `p` elements inside the `main` element. Then, create a `main` element and nest only the two `p` elements inside the `main` element. # --hints--"} +{"_id":"doc-en-freeCodeCamp-49034a9ff648727d91e5e08ea785dedf41a63f5edce870de2b011e029d29ab1b","title":"","text":"{ \"matchUpdateTypes\": [\"minor\", \"patch\", \"pin\", \"digest\"], \"matchCurrentVersion\": \"!/^0/\", \"automerge\": true }, { \"automerge\": true, \"rebaseWhen\": \"behind-base-branch\" } ],"} +{"_id":"doc-en-freeCodeCamp-7ee11c540a42eb871ded4c747de9de1f559ebb6396c3adb2728731987c310f7d","title":"","text":"h4.negative-10.text-nowrap Community Builder img.profile-image(src='https://s3.amazonaws.com/freecodecamp/branden-byers.jpg' alt=\"Branden Byers picture\") h4.text-nowrap Madison, Wisconsin p.negative-10 \"I'm a massage therapist and Stay-at-home-dad. I learned Hypercard, then Rails, but now I feel at home with JavaScript.\" p.negative-10 \"Cookbook author and stay-at-home-dad. Started coding as a kid, got distracted, but now I'm back in full JavaScript force!\" .col-xs-12.col-sm-4.col-md-3.team-member h3.negative-10.text-nowrap Michael Johnson h4.negative-10.text-nowrap Nonprofit Coordinator"} +{"_id":"doc-en-freeCodeCamp-5cb615338fcb8302f75d5ce15a360adfc4a7c7902ec3e12247ce9db8c01e81b6","title":"","text":"h4.negative-10.text-nowrap Live Content Manager img.profile-image(src='https://s3.amazonaws.com/freecodecamp/jason-rueckert.jpg' alt=\"Jason Rueckert's picture\") h4.text-nowrap Seattle, Washington p.negative-10 \"My high school job was testing basketball shoes for Nike. I learned code to work smarter, not harder. I have no thyroid.\" No newline at end of file p.negative-10 \"My high school job was testing basketball shoes for Nike. I learned code to work smarter, not harder. I have no thyroid.\" "} +{"_id":"doc-en-freeCodeCamp-330cd622150b76944f5eec3ca2e11df713f2da69cd243819c313dfa7d84a4e02","title":"","text":"## The `dashedName` Property The `dashedName` property is used to generate the URL path for the superblock, block, or challenge. These should generally match what the `/utils/dasherize.js` helper would output for the file name. The `dashedName` property is used to generate the URL path for the superblock, block, or challenge. These should generally match what the `/utils/slugs.js` helper would output for the file name. "} +{"_id":"doc-en-freeCodeCamp-edde3f97af1b9c1d20c104ee143009a0a9a5b5e3a23e38e4d20cf87cae65a1ff","title":"","text":"# --description-- The `input` element allows you several ways to collect data from a web form. Like anchor (`a`) elements, `input` elements are self-closing and do not need closing tags. The `input` element allows you several ways to collect data from a web form. Like `img` elements, `input` elements are self-closing and do not need closing tags. Nest an `input` element in the `form` element."} +{"_id":"doc-en-freeCodeCamp-8c023bd9c174dd60eb45ff4f0eb83a0b6646810e69bfae63e5e364ccc7ea8c28","title":"","text":"assert.deepEqual(binarySearch(_testArray, 13), [13]); ``` `binarySearch(testArray, 70)` should return `[13, 19, 22, 49, 70]`. ```js assert.deepEqual(binarySearch(_testArray, 70), [13, 19, 22, 49, 70]); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-dedbe593dad015856860019331a9c75d6f7e5a9ef2f4f295a3aa56bc4218f60c","title":"","text":"# --description-- You may be familiar with the `meta` tag already; it is used to specify information about the page, such as the title, description, keywords, and author. You may be familiar with the `meta` element already; it is used to specify information about the page, such as the title, description, keywords, and author. Give your page a `meta` tag with an appropriate `charset` value. Give your page a `meta` element with an appropriate `charset` value. The `charset` attribute specifies the character encoding of the page, and, nowadays, `UTF-8` is the only encoding supported by most browsers."} +{"_id":"doc-en-freeCodeCamp-f225294601a549be9bb0c49fc74067f81f83d8d57a589b68220db410122914ed","title":"","text":"# --description-- Continuing with the `meta` tags, a `viewport` definition tells the browser how to render the page. Including one betters visual accessibility on mobile, and improves _SEO_ (search engine optimisation). Continuing with the `meta` elements, a `viewport` definition tells the browser how to render the page. Including one betters visual accessibility on mobile, and improves _SEO_ (search engine optimisation). Add a `viewport` definition with a `content` attribute detailing the `width` and `initial-scale` of the page."} +{"_id":"doc-en-freeCodeCamp-533752476ed94d6f8810a394628324f7a4cd863c7f460721f0a53daee905ca09","title":"","text":"# --description-- Another important `meta` tag for accessibility and SEO is the `description` definition. The value of the `content` attribute is used by search engines to provide a description of your page. Another important `meta` element for accessibility and SEO is the `description` definition. The value of the `content` attribute is used by search engines to provide a description of your page. Add a `meta` tag with the `name` attribute set to `description`, and give it a useful `content` attribute. Add a `meta` element with the `name` attribute set to `description`, and give it a useful `content` attribute. # --hints-- You should add a new `meta` tag to the `head`. You should add a new `meta` element to the `head`. ```js assert.equal(document.querySelectorAll('meta').length, 3);"} +{"_id":"doc-en-freeCodeCamp-647486fa8011d741b73c3f733f53adcd58ba2dfdbc0e2b72771e672090b7df73","title":"","text":"editorDidMount={editorDidMount} editorWillMount={editorWillMount} onChange={onChange} options={options} options={{ ...options, folding: !hasEditableRegion() }} theme={editorTheme} /> "} +{"_id":"doc-en-freeCodeCamp-f145d9add067bef98909f1fc53dd84b45858c1cd760bf627ccbb6174a5c861d5","title":"","text":"The `console.log(array[0])` prints `50`, and `data` has the value `60`. **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. # --instructions-- Create a variable called `myData` and set it to equal the first value of `myArray` using bracket notation."} +{"_id":"doc-en-freeCodeCamp-e781fa0230b2847d273517248ccc38ad30a6d5eea587c1b3ae05feea34b6843f","title":"","text":"extends ../layout block content .jumbotron .col-sm-8.col-sm-offset-2 form(method='POST') .col-sm-8.col-sm-offset-2.jumbotron form(method='POST', action=\"/forgot\") h1 Forgot Password input(type='hidden', name='_csrf', value=_csrf) .form-group"} +{"_id":"doc-en-freeCodeCamp-739cbd20556a72c00bd81561c375ef4144f1e9e0f9b00cb090709bdaa2f38389","title":"","text":"button.btn.btn-primary(type='submit') i.fa.fa-key | Reset Password"} +{"_id":"doc-en-freeCodeCamp-9a04afbc9f1308209bfe8f46d10ac5ff3182acaba1339d27c5acf1b6c7309d18","title":"","text":".footer-container .col-header { flex: 0 0 100%; padding-bottom: 15px; font-weight: 700; font-size: 16px; text-align: center;"} +{"_id":"doc-en-freeCodeCamp-2936c95e7f9bb910817ac15202599b02cdda8c17b8f44f5c8c6b1bc1d604fd52","title":"","text":"display: flex; flex-direction: row; flex-wrap: wrap; margin: 0px; margin: 0; } .footer-col {"} +{"_id":"doc-en-freeCodeCamp-78bc0a1584aae1b8c776bb60fbca06a5fe1439557ca4d773d7cb76ca7c447e0d","title":"","text":"} .footer-col a { padding: 5px 0px; padding: 5px 0; } .footer-desc-col {"} +{"_id":"doc-en-freeCodeCamp-a7a7e7b2065b99f170e9a80038e7e002ddcb61b1af9bfa1dd195848db340f0a0","title":"","text":"flex-direction: column; } .footer-right { padding-left: 0px; padding-left: 0; } .footer-container .col-spacer { margin-top: 40px;"} +{"_id":"doc-en-freeCodeCamp-b325d6f8e345b50f8f7d4560dd59b7f448eddd0f3227f3979f2424bfc61373a6","title":"","text":"Your `#video` should have a `src` attribute ```js const el = document.getElementById('video') assert(!!el && !!el.src) let el = document.getElementById('video') const sourceNode = el.children; let sourceElement = null; if (sourceNode.length) { sourceElement = [...video.children].filter(el => el.localName === 'source')[0]; } if (sourceElement) { el = sourceElement; } assert(el.hasAttribute('src')); ``` You should have a `form` element with an `id` of `form`"} +{"_id":"doc-en-freeCodeCamp-1d16868d0b78e376669e1122323424e41bf71194256f4c36aa77f7ac541fcabb","title":"","text":"Your `#video` should have a `src` attribute. ```js const el = document.getElementById('video') assert(!!el && !!el.src) let el = document.getElementById('video') const sourceNode = el.children; let sourceElement = null; if (sourceNode.length) { sourceElement = [...video.children].filter(el => el.localName === 'source')[0]; } if (sourceElement) { el = sourceElement; } assert(el.hasAttribute('src')); ``` You should have a `form` element with an `id` of `form`."} +{"_id":"doc-en-freeCodeCamp-3609be05c23183b54d39e4e52c158ef5e632b31d42691504f390919a7c922798","title":"","text":"# --description-- So far you have been using type selectors to style elements. A class selector is defined by a name with a dot directly in front it, like this: So far you have been using type selectors to style elements. A class selector is defined by a name with a dot directly in front of it, like this: ```css .class-name {"} +{"_id":"doc-en-freeCodeCamp-efe08e5186f39f2d637b64d0e5bfabdf2dd08b51c1b6dc0d53483cdfff994a4c","title":"","text":"# --hints-- You should have a `@media (prefers-reduced-motion: no-preference)` rule. You should have one `@media (prefers-reduced-motion: no-preference)` rule. ```js assert.exists(new __helpers.CSSHelp(document).getRuleListsWithinMedia('(prefers-reduced-motion: no-preference)')); assert.equal(new __helpers.CSSHelp(document).getRuleListsWithinMedia('(prefers-reduced-motion: no-preference)').length, 1); ``` You should wrap the existing `*` rule within the `@media` rule."} +{"_id":"doc-en-freeCodeCamp-7824601d77f1a50adb6541f622da660fe1935095b9a3e14e17e6fc5e81651b57","title":"","text":"You should have an opening `` tag with a `lang` attribute of `en`. ```js assert(code.match(//i)); assert(code.match(//gi)); ``` You should have a closing `` tag. Remember that closing tags have a `/` following the opening `<` bracket."} +{"_id":"doc-en-freeCodeCamp-b6b7494f8d011f468fc8fb65931b033c3f5d220b6932563ebe680bedaf447b53","title":"","text":"} ``` This would log `Alan`, `Jeff`, `Sarah`, and `Ryan` - each value on its own line. This would log `Alan`, `Jeff`, and `Sarah` - each value on its own line. In this statement, we defined a variable `user`, and as you can see, this variable was reset during each iteration to each of the object's keys as the statement looped through the object, resulting in each user's name being printed to the console."} +{"_id":"doc-en-freeCodeCamp-ded1f09381db90cf2b30ab44e4ed775ae2caeded0d4be98554f3957526e2577d","title":"","text":"assert(!!el && el.tagName === 'LABEL') ``` Your `#name-label` should not be empty Your `#name-label` should contain text that describes the input. ```js const el = document.getElementById('name-label') assert(!!el && el.innerText.length > 0) ``` Your `#email-label` should not be empty Your `#email-label` should contain text that describes the input. ```js const el = document.getElementById('email-label') assert(!!el && el.innerText.length > 0) ``` Your `#number-label` should not be empty Your `#number-label` should contain text that describes the input. ```js const el = document.getElementById('number-label')"} +{"_id":"doc-en-freeCodeCamp-66c8b120ddd73f3de61d0832acb4e6a9b8b87a2c8264744adb15ef38afdc9a44","title":"","text":"assert(!!el && el.tagName === 'LABEL') ``` Your `#name-label` should not be empty. Your `#name-label` should contain text that describes the input. ```js const el = document.getElementById('name-label') assert(!!el && el.innerText.length > 0) ``` Your `#email-label` should not be empty. Your `#email-label` should contain text that describes the input. ```js const el = document.getElementById('email-label') assert(!!el && el.innerText.length > 0) ``` Your `#number-label` should not be empty. Your `#number-label` should contain text that describes the input. ```js const el = document.getElementById('number-label')"} +{"_id":"doc-en-freeCodeCamp-ac8b61bbe5d203925705df15eb65f93c6787131e72ce40e385c9a9bd8897209a","title":"","text":"# How to Work on Practice Projects Our practice projects use a step-based approach to teach concepts to campers. A project will consist of multiple files, which we refer to as **\"steps\"**. These files are named by the challenge ID, to avoid issues with the translation flow. Unfortunately, this makes it difficult to find the file associated with a specific step. We've built a challenge editor tool that helps remedy this. This tool allows you to navigate the available projects, and the steps for each project (in order). There's also an embedded code editor you can use to work on the files directly. ## Using the Challenge Editor These instructions will tell you how to use our challenge editor tool to work on the practice projects. ### Starting the Editor To start the editor, make sure you are in the root freecodecamp directory. Then, run `npm run challenge-editor` to start both the client and the API that powers the editor. The client will run on port `3300`, so you can access it at `http://localhost:3300`. The API runs on port `3200`, to avoid conflicts with the learn client and server. This will allow you to run the freeCodeCamp application at the same time as the editor, so you can test your changes locally. ### Navigating the Editor The default view will list the available `superblocks` - these are the certifications. Click on the certification link you want to work on. This will take you to the list of blocks. These are the practice projects. Click on the project link you want to work on. This will take you to a list of steps for the project. If you are working on an existing step, you can click on the step link to open the editor. If you are adding or removing steps, click the `Use the step tools` link to switch to the step tools for that challenge. ### Editing Steps When you click on a step, you'll be taken to the editor. This is a basic text editor that offers syntax highlighting. After you have made your changes, click the `Save Changes` button to save your changes. You will get a browser alert letting you know that your changes are ready to commit. Note that you'll need to use `git` manually to stage and commit your files - this tool will not do that for you. ### Step Tools When you click the `Use the step tools` link, you'll be taken to the step tools page. This allows you to add or remove steps from the project. #### Create Next Step Clicking this button will add a new step at the end of the project. This step will use the previous step's code as the seed. #### Create Empty Steps Enter the number of steps you want to add in the input. Then, clicking the button will create that many empty steps at the end of the project. #### Insert Step Enter the step number that you want to add a step _after_. For example, if you want to add a step after `step-12`, enter `12`. Then, click the `Insert Step` button to add the step. The following steps will be re-ordered. #### Delete Step Enter the step number you want to delete. Then click the `Delete Step` button to remove that step. This will automatically update the step numbers for the remaining steps. #### Update Step Titles You should not have to use this tool unless you've manually deleted or added steps. This tool will reorder the step numbers. ## Using the Scripts Manually If you want to work on the steps manually, in your local IDE, you can run the step management scripts directly. The `tools/challenge-helper-scripts` folder contains tools to help facilitate the creation and maintenance of the freeCodeCamp project-based curriculum. ## Create a new project ### Create a new project Run `npm run create-project`. This opens up a command line ui that guides you through the process. Once that has finished, there should be a new challenge in the English curriculum that you can use for the first step of the project. For example, if you created a project called `test-project` in the Responsive Web Design certification, it would be in `curriculum/challenges/english/01-responsive-web-design/test-project`. Run `npm run create-project` from the root directory. This opens up a command line ui that guides you through the process. Once that has finished, there should be a new challenge in the English curriculum that you can use for the first step of the project. For example, if you created a project called `test-project` in the Responsive Web Design certification, it would be in `curriculum/challenges/english/01-responsive-web-design/test-project`. If you want to create new steps, the following tools simplify that process. ## create-next-step ### create-next-step A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### How to run script: #### How to run script: 1. Change to the directory of the project. 2. Run the following npm command:"} +{"_id":"doc-en-freeCodeCamp-3eb0b0c5f00d78420d609b0f0047d471967781b6536881e648aa2e2a026446f0","title":"","text":"npm run create-next-step ``` ## create-empty-steps ### create-empty-steps A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. **Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: #### How to run script: 1. Change to the directory of the project. 2. Run the following npm command:"} +{"_id":"doc-en-freeCodeCamp-d615c8477c0ed8ad7031a91229de37c876d692f5e844206cab6b7b611c1c4276","title":"","text":"npm run create-empty-steps X # where X is the number of steps to create. ``` ## insert-step ### insert-step A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. **Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: #### How to run script: 1. Change to the directory of the project. 2. Run the following npm command:"} +{"_id":"doc-en-freeCodeCamp-7b35e6681bfce7a1d7a5836fc2323f529a004132c9b6d2d71f3e6d941f7b46e5","title":"","text":"npm run insert-step X # where X is the position to insert the new step. ``` ## delete-step ### delete-step A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) **Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script #### How to run script 1. Change to the directory of the project. 2. Run the following npm command:"} +{"_id":"doc-en-freeCodeCamp-783671bb6af22ae3bfc7f968ba37891e47bfec53aa541fb5154096a3cd50a065","title":"","text":"npm run delete-step X # where X is the step number to be deleted. ``` ## update-step-titles ### update-step-titles A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. ### How to run script #### How to run script 1. Change to the directory of the project. 2. Run the following npm command:"} +{"_id":"doc-en-freeCodeCamp-6bb37e7f626c77a612e1f2abbc161c3729f2de4dc1920e04a24d37ef1308937f","title":"","text":"assert(img?.previousElementSibling === null); ``` Your `img` element should have a `class` set to logo. Your `img` element should have a `class` set to `logo`. ```js const img = document.querySelector('img');"} +{"_id":"doc-en-freeCodeCamp-1481c6de585ef4590c47126c794824b41e28ee660333dd21fb666868d5433377","title":"","text":"Add all your code for these lessons in the `server.js` file between the code we have started you off with. Do not change or delete the code we have added for you. BCrypt has already been added as a dependency, so require it ad `bcrypt` in your server. BCrypt has already been added as a dependency, so require it as `bcrypt` in your server. Submit your page when you think you've got it right."} +{"_id":"doc-en-freeCodeCamp-dad0a4b262dc4235b2c1376f04c31ad3a83a220eb7453dd1060254954b83fdb8","title":"","text":"} ]); profileValidation.controller('nonprofitFormController', ['$scope', function($scope) { } ]); profileValidation.directive('uniqueUsername', function($http) { return { restrict: 'A',"} +{"_id":"doc-en-freeCodeCamp-615a9817ca5b7872114006a926e51c51974eeb85c821f4a943a2a63e71828c46","title":"","text":"li • Understand that they will build your project using JavaScript frameworks (as opposed to older or proprietary tools) li • Keep your expectations high. Our students' goal is to produce work that's up to your standards h3 If you're OK with these terms, great! We'd love to help you! Fill in this form and we'll get right back to you. form.form-horizontal(role='form', action=\"/nonprofits/\", method='POST') form.form-horizontal(role='form', action=\"/nonprofits/\", method='POST', novalidate='novalidate', name='nonprofitForm') input(type='hidden', name='_csrf', value=_csrf) .form-group label(class='col-sm-2 control-label', for='name') Your name label(class='col-sm-2 control-label', for='name') Your name * .col-sm-8 input.form-control(type='text', name='name', id='name') input.form-control(type='text', name='name', id='name', autocomplete=\"off\", ng-model='name', required='required') .col-sm-8.col-sm-offset-2(ng-show=\"nonprofitForm.name.$invalid && nonprofitForm.name.$error.required && !nonprofitForm.name.$pristine\") alert(type='danger') span.ion-close-circled(id='#name-error') | Your name is required. .form-group label(class='col-sm-2 control-label', for='email') Your email label(class='col-sm-2 control-label', for='email') Your email * .col-sm-8 input.form-control(type='text', name='email', id='email') input.form-control(type='text', name='email', id='email', autocomplete=\"off\", ng-model='email', required='required') .col-sm-8.col-sm-offset-2(ng-show=\"nonprofitForm.email.$invalid && nonprofitForm.email.$error.required && !nonprofitForm.email.$pristine\") alert(type='danger') span.ion-close-circled(id='#email-error'). Your email is required. .form-group label(class='col-sm-2 control-label', for='message') Briefly describe what problem you need to solve, and for whom. label(class='col-sm-2 control-label', for='message') Briefly describe what problem you need to solve, and for whom. * .col-sm-8 textarea.form-control(type='text', name='message', id='message', rows='7') textarea.form-control(type='text', name='message', id='message', rows='7', autocomplete=\"off\", ng-model='message', required='required') .col-sm-8.col-sm-offset-2(ng-show=\"nonprofitForm.message.$invalid && nonprofitForm.message.$error.required && !nonprofitForm.message.$pristine\") alert(type='danger') span.ion-close-circled(id='#message-error') | Your message is required. .form-group .col-sm-offset-2.col-sm-8 button.btn.btn-primary(type='submit') button.btn.btn-primary(type='submit', ng-disabled='nonprofitForm.$invalid') span.ion-paper-airplane | Submit | Submit No newline at end of file"} +{"_id":"doc-en-freeCodeCamp-fea0de6a400f157168f6bd806ae49e7b5d2c4e41accc621ee978ab5c36dc6958","title":"","text":"**Examples** `3 == '3'` returns `true` because JavaScript performs type conversion from string to number. `3 === '3'` returns false because the types are different and type conversion is not performed. `3 == '3'` returns `true` because JavaScript performs type conversion from string to number. `3 === '3'` returns `false` because the types are different and type conversion is not performed. **Note:** In JavaScript, you can determine the type of a variable or a value with the `typeof` operator, as follows:"} +{"_id":"doc-en-freeCodeCamp-6fe5886ea225b25523730ccf288d056648d6a64afc2fcb50a218a0f6b23036f0","title":"","text":"import React from 'react'; import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'; import { faWindowRestore } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useTranslation } from 'react-i18next'; import EditorTabs from './editor-tabs';"} +{"_id":"doc-en-freeCodeCamp-bc2f2fd3e2007aa685bb3ed37b2a3380f886aa109bd6c99dd0f38c7fccbafa92","title":"","text":"onClick={() => togglePane('showPreviewPortal')} > {getPreviewBtnsSrText().portal}
"} +{"_id":"doc-en-freeCodeCamp-27e2990f887bf9234015676789fde56949759d858006da04a1716d9d21e7bafc","title":"","text":"```js function whatIsInAName(collection, source) { const arr = []; // Only change code below this line // Only change code above this line return arr; } whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });"} +{"_id":"doc-en-freeCodeCamp-f678d913a9c384b61db3b7855ce4bdcebf5ce5ed24a956fee9e3cc649c8333ae","title":"","text":"Moving on to the final `fieldset`. What if you wanted to allow a user to upload a profile picture? 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. 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. # --hints--"} +{"_id":"doc-en-freeCodeCamp-ead547d4cbf04d1a800d229ecd6dbce9c452b89ba1bcf4e905ed0383f5e339f3","title":"","text":"# --description-- After your last `.divider`, create a new `p` element with the text `Cholesterol 0mg 0%`. Wrap the text `Cholesterol` in a `span` element, and give that `span` element the `class` attribute set to `bold`. Wrap the text `0%` in another `span` element, with the `class` set to `bold`. Finally, nest the `Cholesterol` and `0mg` span elements inside an additional span element for alignment. After your last `.divider`, create a new `p` element with the text `Cholesterol 0mg 0%`. Wrap the text `Cholesterol` in a `span` element, and give that `span` element the `class` attribute set to `bold`. Wrap the text `0%` in another `span` element, with the `class` set to `bold`. Finally, nest the `Cholesterol` and `0mg` `span` elements inside an additional `span` element for alignment. # --hints--"} +{"_id":"doc-en-freeCodeCamp-fae528ec0aebda4209409ad5f2705729d72d74704455eae1761848b16d80a556","title":"","text":"You are provided sentences with some missing words, like nouns, verbs, adjectives and adverbs. You then fill in the missing pieces with words of your choice in a way that the completed sentence makes sense. Consider this sentence - It was really **____**, and we **____** ourselves **____**. This sentence has three missing pieces- an adjective, a verb and an adverb, and we can add words of our choice to complete it. We can then assign the completed sentence to a variable as follows: Consider this sentence: ```md It was really ____, and we ____ ourselves ____. ``` This sentence has three missing pieces- an adjective, a verb and an adverb, and we can add words of our choice to complete it. We can then assign the completed sentence to a variable as follows: ```js const sentence = \"It was really \" + \"hot\" + \", and we \" + \"laughed\" + \" ourselves \" + \"silly\" + \".\";"} +{"_id":"doc-en-freeCodeCamp-2749f69335b8746dbdc79c93d660cd8f3cb937c2d0ea27ba49b1e8cb6c906572","title":"","text":"For example: ```console pnpm run cypress -- run --spec=cypress/e2e/default/landing.js pnpm run cypress -- run --spec=cypress/e2e/default/landing.ts ``` - To create a development build, start the development server, and run all existing cypress end-to-end tests:"} +{"_id":"doc-en-freeCodeCamp-1ca92af9c7a9318709265cb74c7f2dd9e6afbdc2298cfc70b1f31d9bc73c6e15","title":"","text":"- Your function must always return the entire `records` object. - If `value` is an empty string, delete the given `prop` property from the album. - If `prop` isn't `tracks` and `value` isn't an empty string, assign the `value` to that album's `prop`. - If `prop` is `tracks` and value isn't an empty string, add the `value` to the end of the album's `tracks` array. You need to create this array first if the album does not have a `tracks` property. - If `prop` is `tracks` and `value` isn't an empty string, you need to update the album's `tracks` array. First, if the album does not have a `tracks` property, assign it an empty array. Then add the `value` as the last item in the album's `tracks` array. **Note:** A copy of the `recordCollection` object is used for the tests. You should not directly modify the `recordCollection` object."} +{"_id":"doc-en-freeCodeCamp-f0f9a99e53b0b02ade166a47ad6dc6c65271f0f6e64333827b0de2284fe98072","title":"","text":"```js switch (expression) { case 1: /* this code will execute if the case matches the expression */ console.log(\"1\"); break; default: /* the default will execute if none of the other cases match the expression */ console.log(\"Not 1\"); } ``` In this example, the first `case` checks if `expression === 1`, and if so logs `1` to the console. If no cases are true, it will log `Not 1` to the console. The `break` statement stops execution of the `switch` when the `case` is true. Add a `switch` statement and use `e.target.value` for the expression. # --hints--"} +{"_id":"doc-en-freeCodeCamp-7acb64986e1690e0ae409c489ae11b0b31fa2803d204c1c4a1a3632863aed9de","title":"","text":"```js case \"example\": // code goes here console.log(\"example\"); break; ```"} +{"_id":"doc-en-freeCodeCamp-95f402ebd3099445318f9a80ef518ed55cb077b996320b6df5b516cbbe18143f","title":"","text":"| --------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------- | | [Node.js](http://nodejs.org) | `18.x` | We use the \"Active LTS\" version, See [LTS Schedule](https://nodejs.org/en/about/releases/). | | [pnpm](https://pnpm.io/installation) | `8.x` | - | | [MongoDB Community Server](https://docs.mongodb.com/manual/administration/install-community/) | `4.2.x` | - | | [MongoDB Community Server](https://docs.mongodb.com/manual/administration/install-community/) | `5.0.x` | - | > [!ATTENTION] > If you have a different version, please install the recommended version. We can only support installation issues for recommended versions. See [troubleshooting](#troubleshooting) for details."} +{"_id":"doc-en-freeCodeCamp-22ef9c21fa3a3e2289de8986c8da7650c0a5b86e0c478fce071e5f24a4eadbf6","title":"","text":"`Thermostat` should be a `class` with a defined `constructor` method. ```js assert( typeof Thermostat === 'function' && typeof Thermostat.constructor === 'function' ); assert.isFunction(Thermostat); assert.isFunction(Thermostat?.constructor); ``` `class` keyword should be used. The `class` keyword should be used. ```js assert(code.match(/class/g)); assert.match(code, /class/); ``` `Thermostat` should be able to be instantiated. ```js assert( (() => { const t = new Thermostat(122); return typeof t === 'object'; })() ); const _t = new Thermostat(122); assert.isObject(_t); ``` When instantiated with a Fahrenheit value, `Thermostat` should set the correct `temperature`. ```js assert( (() => { const t = new Thermostat(122); return t.temperature === 50; })() ); const _t = new Thermostat(122); assert.strictEqual(_t?.temperature, 50); ``` A `getter` should be defined. ```js assert( (() => { const desc = Object.getOwnPropertyDescriptor( Thermostat.prototype, 'temperature' ); return !!desc && typeof desc.get === 'function'; })() ); const _desc = Object.getOwnPropertyDescriptor(Thermostat.prototype, 'temperature'); assert.isFunction(_desc?.get); ``` A `setter` should be defined. ```js assert( (() => { const desc = Object.getOwnPropertyDescriptor( Thermostat.prototype, 'temperature' ); return !!desc && typeof desc.set === 'function'; })() ); const _desc = Object.getOwnPropertyDescriptor(Thermostat.prototype, 'temperature'); assert.isFunction(_desc?.set); ``` Calling the `setter` with a Celsius value should set the `temperature`. ```js assert( (() => { const t = new Thermostat(32); t.temperature = 26; const u = new Thermostat(32); u.temperature = 50; return t.temperature === 26 && u.temperature === 50; })() ); 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); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-6412129831e23c5d265bf19174b860a59a76696ba5c60afabbbefc2daf7fc1d2","title":"","text":"assert(document.querySelector('tbody')?.querySelectorAll('tr')?.[3]?.querySelectorAll('td')?.[2]?.textContent === '$809'); ``` Your third `td` element should have the `class` attribute set to `current`. ```js assert(document.querySelector('tbody')?.querySelectorAll('tr')?.[3]?.querySelectorAll('td')?.[2]?.classList?.contains('current')); ``` # --seed-- ## --seed-contents--"} +{"_id":"doc-en-freeCodeCamp-460b8c03dcf14196e327e5e7a4c3a0adb82adf9b7859c2feb6d57ff1e8f6eb52","title":"","text":"No properties should be added. `Object.keys(Person).length` should always return 6. ```js const person = new Person('Bob', 'Ross'); person.setFirstName('Haskell'); person.setLastName('Curry'); person.setFullName('John', 'Smith'); assert.lengthOf(Object.keys(person), 6); const _person = new Person('Bob', 'Ross'); _person.setFirstName('Haskell'); _person.setLastName('Curry'); _person.setFullName('John', 'Smith'); assert.lengthOf(Object.keys(_person), 6); ``` You should be able to instantiate your `Person` object. ```js const person = new Person('Bob', 'Ross'); assert.instanceOf(person, Person); const _person = new Person('Bob', 'Ross'); assert.instanceOf(_person, Person); ``` Your `Person` object should not have a `firstName` property. ```js const person = new Person('Bob', 'Ross'); assert.notProperty(person, 'firstName'); const _person = new Person('Bob', 'Ross'); assert.notProperty(_person, 'firstName'); ``` Your `Person` object should not have a `lastName` property. ```js const person = new Person('Bob', 'Ross'); assert.notProperty(person, 'lastName'); const _person = new Person('Bob', 'Ross'); assert.notProperty(_person, 'lastName'); ``` The `.getFirstName()` method should return the string `Bob`. ```js const person = new Person('Bob', 'Ross'); assert.strictEqual(person.getFirstName(), 'Bob'); const _person = new Person('Bob', 'Ross'); assert.strictEqual(_person.getFirstName(), 'Bob'); ``` The `.getLastName()` should return the string `Ross`. ```js const person = new Person('Bob', 'Ross'); assert.strictEqual(person.getLastName(), 'Ross'); const _person = new Person('Bob', 'Ross'); assert.strictEqual(_person.getLastName(), 'Ross'); ``` The `.getFullName()` method should return the string `Bob Ross`. ```js const person = new Person('Bob', 'Ross'); assert.strictEqual(person.getFullName(), 'Bob Ross'); const _person = new Person('Bob', 'Ross'); assert.strictEqual(_person.getFullName(), 'Bob Ross'); ``` The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`. ```js const person = new Person('Bob', 'Ross'); person.setFirstName('Haskell'); assert.strictEqual(person.getFullName(), 'Haskell Ross'); const _person = new Person('Bob', 'Ross'); _person.setFirstName('Haskell'); assert.strictEqual(_person.getFullName(), 'Haskell Ross'); ``` The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`. ```js const person = new Person('Bob', 'Ross'); person.setLastName('Curry'); assert.strictEqual(person.getFullName(), 'Bob Curry'); const _person = new Person('Bob', 'Ross'); _person.setLastName('Curry'); assert.strictEqual(_person.getFullName(), 'Bob Curry'); ``` The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`. ```js const person = new Person('Bob', 'Ross'); person.setFullName('Haskell', 'Curry'); assert.strictEqual(person.getFullName(), 'Haskell Curry'); const _person = new Person('Bob', 'Ross'); _person.setFullName('Haskell', 'Curry'); assert.strictEqual(_person.getFullName(), 'Haskell Curry'); ``` The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`. ```js const person = new Person('Bob', 'Ross'); person.setFullName('Haskell', 'Curry'); assert.strictEqual(person.getFirstName(), 'Haskell'); const _person = new Person('Bob', 'Ross'); _person.setFullName('Haskell', 'Curry'); assert.strictEqual(_person.getFirstName(), 'Haskell'); ``` The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`. ```js const person = new Person('Bob', 'Ross'); person.setFullName('Haskell', 'Curry'); assert.strictEqual(person.getLastName(), 'Curry'); const _person = new Person('Bob', 'Ross'); _person.setFullName('Haskell', 'Curry'); assert.strictEqual(_person.getLastName(), 'Curry'); ``` The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`. ```js const person = new Person('Bob', 'Ross'); person.setFullName('Emily Martinez', 'de la Rosa'); assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa'); const _person = new Person('Bob', 'Ross'); _person.setFullName('Emily Martinez', 'de la Rosa'); assert.strictEqual(_person.getFullName(), 'Emily Martinez de la Rosa'); ``` The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`. ```js const person = new Person('Bob', 'Ross'); person.setFullName('Emily Martinez', 'de la Rosa'); assert.strictEqual(person.getFirstName(), 'Emily Martinez'); const _person = new Person('Bob', 'Ross'); _person.setFullName('Emily Martinez', 'de la Rosa'); assert.strictEqual(_person.getFirstName(), 'Emily Martinez'); ``` The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`. ```js const person = new Person('Bob', 'Ross'); person.setFullName('Emily Martinez', 'de la Rosa'); assert.strictEqual(person.getLastName(), 'de la Rosa'); const _person = new Person('Bob', 'Ross'); _person.setFullName('Emily Martinez', 'de la Rosa'); assert.strictEqual(_person.getLastName(), 'de la Rosa'); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-f92871f515bb61ac744596c49ef7f21f872b237e7702c0f9fb92c7354d871781","title":"","text":"

{t('learn.fill-in-the-blank')}

{/* what we want to observe is ctrl/cmd + enter, but ObserveKeys is buggy and throws an error if it encounters a key combination, so we have to pass in the individual keys to observe */}

{splitSentence.map((s, i) => {"} +{"_id":"doc-en-freeCodeCamp-97dde888a7865cd221a867e9cb05a7bc727c0f57a9cf860e9f9ca518b9788b2f","title":"","text":"Your `for` loop should `push` `strArray[i]` to `cleanStrArray`. ```js assert.match(code, /fors*(s*(let|var)s+is*=s*0s*;s*is* assert.match(code, /fors*(s*(let|var)s+is*=s*0s*;s*is* ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-9350ff34c81f33c584f6da6079b46f550f10a7e3d2abf5b18e0477dbfa5bb9a9","title":"","text":"You should add an `else` block to the existing `if` block. ```js assert.match(code, /ifs*(userData?.currentSongs*===s*nulls*||s*userData?.currentSong.ids*!==s*song.id)s*{s*audio.currentTimes*=s*0;?s*}s*elses{/) assert.match(code, /ifs*(userData?.currentSongs*===s*nulls*||s*userData?.currentSong.ids*!==s*song.id)s*{s*audio.currentTimes*=s*0;?s*}s*elses*{/) ``` You should set `audio.currentTime` to `userData.songCurrentTime` inside the `else` block of your `if` statement. ```js assert.match(code, /ifs*(userData?.currentSongs*===s*nulls*||s*userData?.currentSong.ids*!==s*song.id)s*{s*audio.currentTimes*=s*0;?s*}s*elses{s*audio.currentTimes*=s*userData.songCurrentTime;?s*}/) assert.match(code, /ifs*(userData?.currentSongs*===s*nulls*||s*userData?.currentSong.ids*!==s*song.id)s*{s*audio.currentTimes*=s*0;?s*}s*elses*{s*audio.currentTimes*=s*userData.songCurrentTime;?s*}/) ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-9dfc8d84e7346c3f5edc67819232eee98538b2c6d1e3b3e3387bf514809bfae3","title":"","text":"dashedName: task-50 --- # --description--"} +{"_id":"doc-en-freeCodeCamp-50ae99ed20d62cf795810476927eec3e04c3b65164a195b45db67e5ad995a8b7","title":"","text":"## --answers-- `What do she does as our team lead?` `What do she does as the team lead?` ### --feedback--"} +{"_id":"doc-en-freeCodeCamp-288d7ce9223278f76d1ad0a638eb4c7131a78dac45ed6e799658a2acf9d3b3f3","title":"","text":"--- `What does he does as our team lead?` `What does he does as the team lead?` ### --feedback--"} +{"_id":"doc-en-freeCodeCamp-a6dac553ef5bcf533bd5c3f450cfb08b4fb961697a6b671a06e2de70e3edda10","title":"","text":"--- `What do he does as our team lead?` `What do he does as the team lead?` ### --feedback--"} +{"_id":"doc-en-freeCodeCamp-20bdea9f47a6a2d85a10a31b827c31dca3c918732120380e653d93a03e324f0c","title":"","text":"--- `What does she do as our team lead?` `What does she do as the team lead?` ## --video-solution--"} +{"_id":"doc-en-freeCodeCamp-752b2e24371b4f06a812009bb711c540111623589eea5596f413c6a4922e125a","title":"","text":"dashedName: task-55 --- # --description-- Now you will practice listening for the correct form of `do.` Listen carefully to how Tom asks about Maria's job as a team lead. Now you will practice listening for the correct form of `do`. Listen carefully to how Tom asks about Maria's job as a team lead. # --instructions--"} +{"_id":"doc-en-freeCodeCamp-9c9ff29ae2c51e3cb29bd30b06fcf9adcc5fd130cfa771c979f1ad1586cc107a","title":"","text":"## --sentence-- `Those are great traits for someone in her position, I think. What _ she _ as our team lead?` `Those are great traits for someone in her position, I think. What _ she _ as the team lead?` ## --blanks--"} +{"_id":"doc-en-freeCodeCamp-4f7a5b40d00ea67c7ef4336cc27bce1629ef21a559d8974da062deb3500c2b43","title":"","text":"assert.match(code, /localStorage.setItem((\"|')data1/) ``` Your `localStorage.setItem()` should have a key of `myTaskArr`. Your `localStorage.setItem()` should have a value of `myTaskArr`. ```js assert.match(code, /localStorage.setItem((\"|')data1,s*myTaskArr);?/)"} +{"_id":"doc-en-freeCodeCamp-e425bbdac185dd58ecf5fec4beae2ed8b5f276c9b15bbd62ae4c67cacb57f88b","title":"","text":"Pass in only the first element of the `locations` array by adding `[0]` at the end of the variable. For example: `myFunction(arg[0]);`. This is called bracket notation. Values in an array are accessed by index. Indices are numerical values and start at 0 - this is called zero-based indexing. `arg[0]` would be the first element in the `arg` array. This is called bracket notation. Values in an array are accessed by index. Indices are numerical values and start at `0` - this is called zero-based indexing. `arg[0]` would be the first element in the `arg` array. # --hints--"} +{"_id":"doc-en-freeCodeCamp-5ef7dedf806b7fdb07c5f693505e991a4526e3340503b2f25c1d37214bc2508f","title":"","text":"The attack of the monster will be based on the monster's `level` and the player's `xp`. In the `getMonsterAttackValue` function, use `const` to create a variable called `hit`. Assign it the equation `(level * 5) - (Math.floor(Math.random() * xp));`. This will set the monster's attack to five times their `level` minus a random number between 0 and the player's `xp`. This will set the monster's attack to five times their `level` minus a random number between `0` and the player's `xp`. # --hints--"} +{"_id":"doc-en-freeCodeCamp-193ada1f903cb72746ea0ceaefdf6085db19a14c4ba4822b395ba0498f59178a","title":"","text":"### --feedback-- Places where you can buy and eat food. Don't forget the stress mark. Places where you can buy and eat food. Don't forget the stress mark (`é`). # --scene--"} +{"_id":"doc-en-freeCodeCamp-e9b4a6ac98179f12ce325c81c9b6ab14551c26d3b54f3288e080ac2444141ea0","title":"","text":"### --feedback-- Places to eat or drink. Don't forget the stress mark. Places to eat or drink. Don't forget the stress mark (`é`). ---"} +{"_id":"doc-en-freeCodeCamp-1f076b99e3c7c67284df98b6e95436e176ee4824ca5e50800ade88eb50ff25da","title":"","text":"You should use the concatenation operator on your `result` variable. ```js assert.match(code, /results*+/); assert.match(code, /(?:results*+|+s*result)/); ``` You should concatenate `row` to your `result` variable. ```js assert.match(code, /results*+s*row/); assert.match(code, /results*+s*row|rows*+s*result/); ``` You should assign the result of your concatenation back to the `result` variable. ```js assert.match(code, /results*=s*results*+s*row;?/) assert.match(code, /results*=s*(results*+s*row|rows*+s*result);?/); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-750747c0de366fdc61bd395347ae9d85b96e0c4117fe270d116ebb0235cb8f38","title":"","text":"```js const afterCalculateTotal = code.split('calculateTotal')[1]; assert.match(afterCalculateTotal, /(s*totals*,s*items*)s*=>s*totals*+s*item.price/); assert.match(afterCalculateTotal, /(s*totals*,s*items*)s*=>s*(?:totals*+s*item.price|item.prices*+s*total)/); ``` Your `reduce` call should have an initial value of `0`. ```js const afterCalculateTotal = code.split('calculateTotal')[1]; assert.match(afterCalculateTotal, /thiss*.s*itemss*.s*reduces*(s*(s*totals*,s*items*)s*=>s*totals*+s*item.prices*,s*0s*)/); assert.match(afterCalculateTotal, /thiss*.s*itemss*.s*reduces*(s*(s*totals*,s*items*)s*=>s*(?:totals*+s*item.price|item.prices*+s*total)s*,s*0s*)/); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-1caaf0bb206d255294a1d5f8fa11a27db22eec215fb0de23e1bfbc9e312cde25","title":"","text":"programmer = \"CamperChan\"; ``` Note that when reassigning a variable that has already been declared, you do **not** use the `let` keyword. Note that when reassigning a variable, you do **not** use the `let` keyword again. After your `console.log`, assign the value `\"World\"` to your `character` variable."} +{"_id":"doc-en-freeCodeCamp-c3af8062adddbf73c195b7865633133e86c345ce3feca7e3d67502f2e8239771","title":"","text":"# --description-- You used the `inputVal` property as the `id` attribute for your paragraph elements. Now you can target those the paragraph elements with those `id`s. You have set the `id` attribute for your paragraph elements to the `obj.inputVal` property. Use the `.getElementById()` method to select the element with the `id` attribute with the value of the `inputVal` property of the current object. Now, use `getElementById` to select the element with that attribute value, again using the `obj.inputVal` property. # --hints--"} +{"_id":"doc-en-freeCodeCamp-7247e86453a7e100b5758504925d65575f9196183c23c89bf68c52425f02f100","title":"","text":"assert.match(calculateCalories.toString(), /document.querySelectorAll(s*('|\")#breakfast input[s*type=numbers*]s*1s*)/); ``` You should assign the result of your `odocument.querySelectorAll()` call to `breakfastNumberInputs`. You should assign the result of your `document.querySelectorAll()` call to `breakfastNumberInputs`. ```js assert.match(calculateCalories.toString(), /breakfastNumberInputss*=s*document.querySelectorAll(s*('|\")#breakfast input[s*type=numbers*]s*1s*)/);"} +{"_id":"doc-en-freeCodeCamp-1c0da98c60c51e0c05cbb34f240e41b8868766345e5c6bc3f7177c1b8a5de478","title":"","text":"# --description-- You have accessed elements (characters) of a string before, using the index operator `[]`. You can also use the index operator to access a range of characters in a string with `string[x:y:h]`: You have accessed elements (characters) of a string before, using the index operator `[]`. You can also use the index operator to access a range of characters in a string with `string[start:stop:step]`: ```python my_string = 'camperbot' camper = my_string[0:6] cp = my_string[0:6:3] my_string[0:6] == 'camper' # True my_string[0:6:3] == 'cp' # True ``` Where `x` is the starting index, `y` is the ending index, and `h` is the step (the amount of characters to skip over). Where `start` is the starting index (inclusive), `stop` is the ending index (exclusive), and `step` is the amount of characters to skip over. If not specified, `step` is default to 1. Create a variable named `card_number_reversed` and assign it the value of the first 4 characters of `card_number`."} +{"_id":"doc-en-freeCodeCamp-c0efafa170a2d1265e52c7e95ef36c33011993b5e3c752485c9c6a946396bd6c","title":"","text":"assert.match(code, /taskData.forEach(s*/) ``` You should destructure `id`, `title`, `date`, `description` as the parameters of the callback of your `forEach()`. You should use `{id, title, date, description}` as the destructured parameters of the `forEach()` callback function. ```js assert.match(code, /taskData.forEach(s*(s*{s*(?:ids*,s*titles*,s*dates*,s*description)|(?:titles*,s*ids*,s*dates*,s*description)|(?:dates*,s*ids*,s*titles*,s*description)|(?:ids*,s*dates*,s*titles*,s*description)|(?:titles*,s*dates*,s*ids*,s*description)|(?:dates*,s*titles*,s*ids*,s*description)|(?:dates*,s*titles*,s*descriptions*,s*id)|(?:titles*,s*dates*,s*descriptions*,s*id)|(?:descriptions*,s*dates*,s*titles*,s*id)|(?:dates*,s*descriptions*,s*titles*,s*id)|(?:titles*,s*descriptions*,s*dates*,s*id)|(?:descriptions*,s*titles*,s*dates*,s*id)|(?:descriptions*,s*ids*,s*dates*,s*title)|(?:ids*,s*descriptions*,s*dates*,s*title)|(?:dates*,s*descriptions*,s*ids*,s*title)|(?:descriptions*,s*dates*,s*ids*,s*title)|(?:ids*,s*dates*,s*descriptions*,s*title)|(?:dates*,s*ids*,s*descriptions*,s*title)|(?:titles*,s*ids*,s*descriptions*,s*date)|(?:ids*,s*titles*,s*descriptions*,s*date)|(?:descriptions*,s*titles*,s*ids*,s*date)|(?:titles*,s*descriptions*,s*ids*,s*date)|(?:ids*,s*descriptions*,s*titles*,s*date)|(?:descriptions*,s*ids*,s*titles*,s*date)s*}/)"} +{"_id":"doc-en-freeCodeCamp-4686fe8300776ca49a55dc4db0f9558dd72077f9f4c93a2fb5612abb9ab34fbf","title":"","text":"# --description-- Add a `range` property which generates a range from `nums`. Remember that you have a `range` function you can reuse here. Add a `range` property which generates a range from the first number in `nums` to the second number in `nums`. Remember that you have a `range` function you can reuse here. # --hints--"} +{"_id":"doc-en-freeCodeCamp-d86d0d308f5bf86c1441ce209a469926a29c64d6f1e17954153bfb629e0d09d2","title":"","text":" )} {id && ( {`${username}'s Solution to ${ idToNameMap.get(id)?.challengeTitle ?? '' }`} If a large straight is rolled, your `checkForStraights` function should enable the fifth radio button, set the value to `40`, and update the displayed text to `, score = 0`. If a large straight is rolled, your `checkForStraights` function should enable the fifth radio button, set the value to `40`, and update the displayed text to `, score = 40`. ```js resetRadioOptions();"} +{"_id":"doc-en-freeCodeCamp-f2098f4d39e68d814e59e66d3686a465111b33bd13afffd63c93d0c9c70082fe","title":"","text":"let x = 20; console.log(x); } myFunction(); ``` ## --answers--"} +{"_id":"doc-en-freeCodeCamp-be80b4c59c6c55b3b2d12ee697b115fecd0669761ac6b35d327e1a8864cece9b","title":"","text":"# --description-- Inside the template literal, create a `div` element with the `id` set to the `index` from the `.forEach()` array method. Remember to use template interpolation to do this. Inside the template literal, create a `div` element with the `id` set to the `index` from the `.forEach()` array method. Remember to use string interpolation to do this. Also, add a `class` of `\"user-card\"` to the `div`."} +{"_id":"doc-en-freeCodeCamp-254df91b4dd83ed27e6822926cd7e9e3e298a5196828676e59bad120d391f5f7","title":"","text":"assert.include(document.querySelector('#author-container > div')?.className, 'user-card'); ``` Your `div` element should have the `id` of `index`. Remember to use template interpolation to set the `id`. Your `div` element should have the `id` of `index`. Remember to use string interpolation to set the `id`. ```js displayAuthors([{author: \"Naomi\"}]);"}