diff --git "a/freeCodeCamp/i2c/dev/corpus.jsonl" "b/freeCodeCamp/i2c/dev/corpus.jsonl" new file mode 100644--- /dev/null +++ "b/freeCodeCamp/i2c/dev/corpus.jsonl" @@ -0,0 +1,245 @@ +{"_id":"doc-en-freeCodeCamp-a64f1d87dd0b110303cc38a4cc0afcaebaa69c55c2547808ba1ec1b7af68ed08","title":"","text":"{ \"node\": true /* * ENVIRONMENTS * ================= */ // Define globals exposed by Node.js. \"node\": true, /* * ENFORCING OPTIONS * ================= */ // Force all variable names to use either camelCase style or UPPER_CASE // with underscores. \"camelcase\": true, // Prohibit use of == and != in favor of === and !==. \"eqeqeq\": true, // Suppress warnings about == null comparisons. \"eqnull\": true, // Enforce tab width of 2 spaces. \"indent\": 2, // Prohibit use of a variable before it is defined. \"latedef\": true, // Require capitalized names for constructor functions. \"newcap\": true, // Enforce use of single quotation marks for strings. \"quotmark\": \"single\", // Prohibit trailing whitespace. \"trailing\": true, // Prohibit use of explicitly undeclared variables. \"undef\": true, // Warn when variables are defined but never used. \"unused\": true, // Enforce line length to 80 characters \"maxlen\": 80 }"} +{"_id":"doc-en-freeCodeCamp-78ba46e386c37d6b99f989267de7006cdf68144f63df2a048b70fb9c4444950a","title":"","text":" { /* * ENVIRONMENTS * ================= */ // Define globals exposed by modern browsers. \"browser\": true, // Define globals exposed by jQuery. \"jquery\": true, /* * ENFORCING OPTIONS * ================= */ // Force all variable names to use either camelCase style or UPPER_CASE // with underscores. \"camelcase\": true, // Prohibit use of == and != in favor of === and !==. \"eqeqeq\": true, // Suppress warnings about == null comparisons. \"eqnull\": true, // Enforce tab width of 2 spaces. \"indent\": 2, // Prohibit use of a variable before it is defined. \"latedef\": true, // Require capitalized names for constructor functions. \"newcap\": true, // Enforce use of single quotation marks for strings. \"quotmark\": \"single\", // Prohibit trailing whitespace. \"trailing\": true, // Prohibit use of explicitly undeclared variables. \"undef\": true, // Warn when variables are defined but never used. \"unused\": true, // Enforce line length to 80 characters \"maxlen\": 80, // Enforce placing 'use strict' at the top function scope \"strict\": true' } "} +{"_id":"doc-en-freeCodeCamp-788e85ed25dac66e99641c74afc08c8c83d16f4d17e978eaa550fb8280dde013","title":"","text":"وهي مقسمة إلى الفئات التالية: * الأعداد الصحيحة * أرقام النقطة العائمة * الشخصيات * اكتب منطقي * الاعداد العشرية * الرموز * القيم المنطقية تفاصيل كل نوع من أنواع البيانات مذكورة أدناه: ## الأعداد الصحيحة: هذه هي من أربعة أنواع: `byte` ، `short` ، `int` ، `long` . من المهم ملاحظة أن هذه القيم موجبة وسالبة. يتم تخزين الأعداد الصحيحة في جهاز الكمبيوتر باستخدام [مكمل 2](http://www.ele.uri.edu/courses/ele447/proj_pages/divid/twos.html) . ويتكون من قيم سلبية وإيجابية ولكن بصيغ مختلفة مثل `(-1 to -128)` أو `(0 to +127)` . يمكن أن يحتوى عدد صحيح غير موقعة على قيمة موجبة أكبر ، ولا توجد قيمة سالبة مثل `(0 to 255)` . على عكس C ++ لا يوجد عدد صحيح غير موقعة في Java. هذه هي من أربعة أنواع: `byte` ، `short` ، `int` ، `long` . من المهم ملاحظة أن هذه القيم موجبة وسالبة. يتم تخزين الأعداد الصحيحة في جهاز الكمبيوتر باستخدام [مكمل 2](http://www.ele.uri.edu/courses/ele447/proj_pages/divid/twos.html) . ويتكون من قيم سالبة وموجبة ولكن بصيغ مختلفة مثل `(-1 to -128)` أو `(0 to +127)` . يمكن أن يحتوى عدد صحيح غير موقعة على قيمة موجبة أكبر ، ولا توجد قيمة سالبة مثل `(0 to 255)` . على عكس C ++ لا يوجد عدد صحيح غير موقعة في Java. ### بايت: ### بايت (byte): نوع البيانات بايت هو عدد صحيح مكمل 8 بت موقعة اثنين. `Wrapper Class: Byte `Wrapper Class (الفئة): Byte Minimum value: -128 (-2^7) Minimum value (القيمة الاصغر): -128 (-2^7) Maximum value: 127 (2^7 -1) Maximum value (القيمة القصوى): 127 (2^7 -1) Default value: 0 Default value (القيمة الافتراضية): 0 Example: byte a = 10 , byte b = -50; Example (مثال): byte a = 10 , byte b = -50; ` ### قصيرة: ### قصيرة (short): نوع البيانات القصير هو عدد صحيح مكمل من 16 بت موقعة اثنين. `Wrapper Class: Short `Wrapper Class (الفئة): Short Minimum value: -32,768 (-2^15) Minimum value (القيمة الصغرى): -32,768 (-2^15) Maximum value: 32,767 (2^15 -1) Maximum value (القيمة القصوى): 32,767 (2^15 -1) Default value: 0. Default value (القيمة الافتراضية): 0. Example: short s = 10, short r = -1000; Example (مثال): short s = 10, short r = -1000; ` ### الباحث: ### العدد الصحيح (integer): نوع البيانات IN هو عدد صحيح مكمل 32 بت موقعة اثنين. يتم استخدامه بشكل عام كنوع بيانات افتراضي للقيم المتكاملة إلا إذا كان هناك قلق حول الذاكرة. `Wrapper Class: Integer `Wrapper Class (الفئة): Integer Minimum value: (-2^31) Minimum value (القيمة الصغرى): (-2^31) Maximum value: (2^31 -1) Maximum value (القيمة القصوى): (2^31 -1) The default value: 0. The default value (القيمة الافتراضية): 0. Example: int a = 50000, int b = -20 Example (مثال): int a = 50000, int b = -20 ` ### طويل: ### طويل (long): نوع بيانات طويل هو عدد صحيح مكمل 64 بت موقعة اثنين. `Wrapper Class: Long `Wrapper Class (الفئة): Long Minimum value: (-2^63) Minimum value (القيمة الصغرى): (-2^63) Maximum value: (2^63 -1) Maximum value (القيمة القصوى): (2^63 -1) Default value: 0L. Default value (القيمة الافتراضية): 0L. Example: long a = 100000L, long b = -600000L; Example (مثال): long a = 100000L, long b = -600000L; By default all integer type variable is \"int\". So long num=600851475143 will give an error. But it can be specified as long by appending the suffix L (or l) ` ## نقطة عائمة: ## اعداد عشرية: تسمى هذه أيضًا أرقامًا حقيقية وتستخدم للتعبيرات التي تتضمن دقة كسرية. هذه من نوعين: `float` ، `double` . يتم تجنب Float فعليًا في حالة البيانات الدقيقة مثل بيانات العملات أو الأبحاث. ### تطفو: ### تطفو (float): نوع بيانات عائم عبارة عن [نقطة عائمة IEEE 754](http://steve.hollasch.net/cgindex/coding/ieeefloat.html) ذات دقة واحدة 32 بت. `Wrapper Class: Float `Wrapper Class (الفئة): Float Float is mainly used to save memory in large arrays of floating point numbers. اساسا تستخدم لحفظ الذاكرة في المصفوفات المكونة من الارقام العشرية ذات دقة واحدة(float) Default value: 0.0f. Default value (القيمة الافتراضية): 0.0f. Example: float f1 = 24.5f; Example (مثال): float f1 = 24.5f; The default data type of floating-point number is double. So float f = 24.5 will introduce an error. نوع القيمة الافتراضية للارقام العشرية ذات دقة واحدة هو مزدوج. مثال: float f = 24.5 ستظهر خطا للمستخدم However, we can append the suffix F (or f) to designate the data type as float. لكن, بامكاننا استخدام F(or f) لتعيين توع البيانات كرقم عشري ذات دقة واحدة (float) The default data type of floating-point number is double. So float f = 24.5 will introduce an error. However, we can append the suffix F (or f) to designate the data type as float. ` ### مزدوج: ### مزدوج (double): نوع بيانات مزدوج هو [نقطة عائم IEEE 754](http://steve.hollasch.net/cgindex/coding/ieeefloat.html) مزدوجة الدقة 64 بت. عادةً ما يكون نوع البيانات هذا هو الخيار الافتراضي. يجب عدم استخدام نوع البيانات هذا مطلقًا للقيم الدقيقة ، مثل العملة."} +{"_id":"doc-en-freeCodeCamp-805ad3e384fb06295767ac5bcad30236c3a5d681994725daf735c0f358c9898d","title":"","text":"``` 10198442 ``` No newline at end of file ``` "} +{"_id":"doc-en-freeCodeCamp-1e5402fbb2e3b148702a2b48e1c016f4826c80acc89e0f53270e482b34026876","title":"","text":"## Byzantine Fault Tolerance Imagine the scenario where there is an empire and there are three generals with their respective armies at different positions. All of them must attack in order to win the fight or they can choose to retreat. Their only means of communications are through pigeon posts. But there is a problem, the generals can't trust each other or ensure that the message has not been corrupted along the way. How do they solve this problem? Blockchain essentially does so by listening to information broadcasted by other people, reaching to a consensus of which information is deemed true. As such, this model asssumes that the amount of \"traitors\" do not exceed more than 1/3 of the entire network. ## Modern Use Cases of Blockchain - Asset Tokenization : Using blockchain technology, previously illiquid assets can now be converted into its tokenized form and cheaply and efficiently fractionalized, traded and settled on chain (rather than go through the lengthy process of clearing and settlement process through third parties like clearing houses) - Supply Chain Management : Blockchains allow multiple parties to access a database to act as the single source of truth. Recorded transactions are immutable, are append only and provide a time stamped audit trail. - Digital Identity : A self sovereign ID can be used to verify identity without needing an individual to produce numerous documents and paperwork each time they need their identity verified. This could be done with a single key that can be matched against an immutable ledger. The digital ID can also collect other online information about a user’s identity like social security information, medical records and social media credentials and have that stored securely on the blockchain. - Energy Market : Blockchain technology can enable the smart metering of electricity generated through an individual’s solar panels to be recorded, traded and settled on a ledger. - Healthcare : Using blockchain technology to record patient information on a distributed ledger can allow different stakeholders conditional access to a single source of truth where each interaction with a patient’s health data can be recorded on a ledger as a transaction with a time stamped audit trail. ## Issues Whilst blockchain technology is undoubtedly elegant, there are several problems that its presence brings, the main one being use my malicious third parties. Due to the extremely secure nature of blockchain, its technologies are often used by criminals to carry out transactions, which are impossible for governments to track."} +{"_id":"doc-en-freeCodeCamp-814f7ba15377430a6a714618ff600b9c391c1d447d33ae817b3b15800ae3ab16","title":"","text":"\"description\": [ \"Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.\" ], \"challengeSeed\": \"function chunk(arr, size) {n // Break it up.rn return arr;rn}nnchunk((['a', 'b', 'c', 'd'], 2));\", \"challengeSeed\": \"function chunk(arr, size) {n // Break it up.rn return arr;rn}nnchunk(['a', 'b', 'c', 'd'], 2);\", \"tests\": [ \"assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays');\", \"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays');\","} +{"_id":"doc-en-freeCodeCamp-fcdd8dd357796a561a09cba2911fb9842b959bfd796be45756c34f710f9102b7","title":"","text":"\"description\": [ \"Return the remaining elements of an array after chopping off n elements from the head.\" ], \"challengeSeed\": \"function slasher(arr) {n // it doesn't allways pay to be firstrn return arr;rn}nnslasher([1, 2, 3], 2);\", \"challengeSeed\": \"function slasher(arr, howMany) {n // it doesn't allways pay to be firstrn return arr;rn}nnslasher([1, 2, 3], 2);\", \"tests\": [ \"assert.deepEqual(slasher([1, 2, 3], 2), [3], 'should drop the first two elements');\", \"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'should return all elements when n < 1');\","} +{"_id":"doc-en-freeCodeCamp-4d0883869b833d48b0ea3655822d5459d2864a6679cf6ffe57479e75d51ab8c4","title":"","text":"] }, { \"_id\":\"a8e512fbe388ac2f9198f0fa\", \"name\":\"Where art thou\", \"difficulty\":\"1.55\", \"description\":[ \"Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).\" ], \"challengeEntryPoint\":\"where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });\", \"challengeSeed\":\"function where(collection, source) {n var arr = [];rn // What's in a name?rn return arr;rn}\", \"tests\":[ \"assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');\", \"assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');\" ] }, { \"_id\":\"a39963a4c10bc8b4d4f06d7e\", \"name\":\"Seek and Destroy\", \"difficulty\":\"1.60\","} +{"_id":"doc-en-freeCodeCamp-9f803ed6cd571814a3db9e507b895d2286a78fd747e9605eff1d726019439a61","title":"","text":"\"name\":\"Seek and Destroy\", \"difficulty\":\"1.60\", \"description\":[ \"Remove all values (last argument(s)) from an array (first argument) and return as a new array.\" \"You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.\" ], \"challengeSeed\": \"function destroyer(arr) {n // Remove all the valuesrn return arr;rn}nndestroyer([1, 2, 3, 1, 2, 3], 2, 3);\", \"tests\": [ \"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'should remove correct values from an array');\", \"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'should remove correct values from an array');\" ], \"MDNlinks\" : [\"Array.filter()\"] \"MDNlinks\" : [\"Arguments object\",\"Array.filter()\"] }, { \"_id\": \"a24c1a4622e3c05097f71d67\","} +{"_id":"doc-en-freeCodeCamp-575e98e3a5a7392d6ad4ab666b520d4019cffec4bf24e6d15bc2016906120e8e","title":"","text":"_ = require('lodash'), fs = require('fs'), constantStrings = require('constantStrings.json'), constantStrings = require('./constantStrings.json'), User = require('../models/User'), Challenge = require('./../models/Challenge'), Story = require('./../models/Story'),"} +{"_id":"doc-en-freeCodeCamp-b6c5145a840ae6d7e4f3fbab113db4eaa91949b0b7e17b688e5bd52631caeec2","title":"","text":" var moment = require('moment'), /* eslint-disable no-catch-shadow, no-unused-vars */ var R = require('ramda'), debug = require('debug')('freecc:cntr:story'), Story = require('./../models/Story'), Comment = require('./../models/Comment'), User = require('./../models/User'), moment = require('moment'), resources = require('./resources'), mongodb = require('mongodb'), nodemailer = require('nodemailer'), sanitizeHtml = require('sanitize-html'), MongoClient = mongodb.MongoClient, resources = require('./resources'), secrets = require('../config/secrets'), Story = require('./../models/Story'), Comment = require('./../models/Comment'), User = require('./../models/User'); nodemailer = require('nodemailer'), sanitizeHtml = require('sanitize-html'); function hotRank(timeValue, rank) { /*"} +{"_id":"doc-en-freeCodeCamp-90e7307950a3cb00fa167e73b79b03341de7c01606b532178c921ae99288011d","title":"","text":"); story.markModified('rank'); story.save(); User.find({ '_id': story.author.userId }, function(err, user) { User.findOne({'_id': story.author.userId}, function(err, user) { if (err) { return next(err); } user = user.pop(); user.progressTimestamps.push(Date.now() || 0); user.save(function (err) { req.user.save(function (err) { user.save(function (err, user) { req.user.save(function (err, user) { if (err) { return next(err); }"} +{"_id":"doc-en-freeCodeCamp-a4e06f41b5add118917f29d3e842c6747e1fa34a002422b1bdf06227a5b1dc24","title":"","text":"if (link.search(/^https?:///g) === -1) { link = 'http://' + link; } Story.count( { storyLink: new RegExp('^' + storyLink + '(?: [0-9]+)?$', 'i') }, function (err, storyCount) { if (err) { return res.status(500); } Story.count({ storyLink: new RegExp('^' + storyLink + '(?: [0-9]+)?$', 'i')}, function (err, storyCount) { if (err) { return res.status(500); } // if duplicate storyLink add unique number storyLink = (storyCount === 0) ? storyLink : storyLink + ' ' + storyCount; // if duplicate storyLink add unique number storyLink = (storyCount === 0) ? storyLink : storyLink + ' ' + storyCount; var link = data.link; if (link.search(/^https?:///g) === -1) { link = 'http://' + link; var link = data.link; if (link.search(/^https?:///g) === -1) { link = 'http://' + link; } var story = new Story({ headline: sanitizeHtml(data.headline, { allowedTags: [], allowedAttributes: [] }).replace(/"/g, '\"'), timePosted: Date.now(), link: link, description: sanitizeHtml(data.description, { allowedTags: [], allowedAttributes: [] }).replace(/"/g, '\"'), rank: 1, upVotes: [({ upVotedBy: req.user._id, upVotedByUsername: req.user.profile.username })], author: { picture: req.user.profile.picture, userId: req.user._id, username: req.user.profile.username, email: req.user.email }, comments: [], image: data.image, storyLink: storyLink, metaDescription: data.storyMetaDescription, originalStoryAuthorEmail: req.user.email }); story.save(function (err) { if (err) { return res.status(500); } var story = new Story({ headline: sanitizeHtml(data.headline, { allowedTags: [], allowedAttributes: [] }).replace(/"/g, '\"'), timePosted: Date.now(), link: link, description: sanitizeHtml(data.description, { allowedTags: [], allowedAttributes: [] }).replace(/"/g, '\"'), rank: 1, upVotes: [({ upVotedBy: req.user._id, upVotedByUsername: req.user.profile.username })], author: { picture: req.user.profile.picture, userId: req.user._id, username: req.user.profile.username, email: req.user.email }, comments: [], image: data.image, storyLink: storyLink, metaDescription: data.storyMetaDescription, originalStoryAuthorEmail: req.user.email }); story.save(function (err) { req.user.progressTimestamps.push(Date.now() || 0); req.user.save(function (err, user) { if (err) { return res.status(500); return next(err); } req.user.progressTimestamps.push(Date.now() || 0); req.user.save(function (err) { if (err) { return next(err); } }); res.send(JSON.stringify({ storyLink: story.storyLink.replace(/s/g, '-').toLowerCase() })); }); } ); res.send(JSON.stringify({ storyLink: story.storyLink.replace(/s/g, '-').toLowerCase() })); }); }); }; exports.commentSubmit = function(req, res, next) {"} +{"_id":"doc-en-freeCodeCamp-88b8c23e74a6912b5fdf114e186fe72079adbc930cd1282a9f1e9ba3a958bfd5","title":"","text":"try { // Based on the context retrieve the parent // object of the comment (Story/Comment) Context.find( { '_id': data.associatedPost }, function (err, associatedContext) { Context.find({'_id': data.associatedPost}, function (err, associatedContext) { if (err) { return next(err); } associatedContext = associatedContext.pop(); if (associatedContext) { associatedContext.comments.push(data._id); associatedContext.save(function (err) { if (err) { return next(err); } res.send(true); }); } // Find the author of the parent object User.findOne({'profile.username': associatedContext.author.username}, function(err, recipient) { if (err) { return next(err); } associatedContext = associatedContext.pop(); if (associatedContext) { associatedContext.comments.push(data._id); associatedContext.save(function (err) { if (err) { return next(err); // If the emails of both authors differ, // only then proceed with email notification if ( typeof data.author !== 'undefined' && data.author.email && typeof recipient !== 'undefined' && recipient.email && (data.author.email !== recipient.email) ) { var transporter = nodemailer.createTransport({ service: 'Mandrill', auth: { user: secrets.mandrill.user, pass: secrets.mandrill.password } res.send(true); }); } // Find the author of the parent object User.findOne( { 'profile.username': associatedContext.author.username }, function(err, recipient) { var mailOptions = { to: recipient.email, from: 'Team@freecodecamp.com', subject: data.author.username + ' replied to your post on Camper News', text: [ 'Just a quick heads-up: ', data.author.username, ' replied to you on Camper News.', 'You can keep this conversation going.', 'Just head back to the discussion here: ', 'http://freecodecamp.com/news/', data.originalStoryLink, '- the Free Code Camp Volunteer Team' ].join('n') }; transporter.sendMail(mailOptions, function (err) { if (err) { return next(err); return err; } // If the emails of both authors differ, // only then proceed with email notification if ( typeof data.author !== 'undefined' && data.author.email && typeof recipient !== 'undefined' && recipient.email && (data.author.email !== recipient.email) ) { var transporter = nodemailer.createTransport({ service: 'Mandrill', auth: { user: secrets.mandrill.user, pass: secrets.mandrill.password } }); var mailOptions = { to: recipient.email, from: 'Team@freecodecamp.com', subject: data.author.username + ' replied to your post on Camper News', text: [ 'Just a quick heads-up: ', data.author.username, ' replied to you on Camper News.', 'You can keep this conversation going.', 'Just head back to the discussion here: ', 'http://freecodecamp.com/news/', data.originalStoryLink, '- the Free Code Camp Volunteer Team' ].join('n') }; transporter.sendMail(mailOptions, function (err) { if (err) { return err; } }); } } ); } ); }); } }); }); } catch (e) { // delete comment return next(err); } });"} +{"_id":"doc-en-freeCodeCamp-a311801fa9959cbbbfaeefe7afe38d9404cfb5e0d5154a52eefa68bf06f8085a","title":"","text":"return next(err); } req.flash('success', { msg: 'Success! You are logged in.' }); if (/hotStories/.test(req.session.returnTo)) { return res.redirect('../news'); } return res.redirect(req.session.returnTo || '/'); }); })(req, res, next);"} +{"_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-ac7f1bb33e36a17f5ed4fa7ed733cd025d4777b88c4f76744553f8a42ca68cfd","title":"","text":"\"description\": [ \"Delete your h2 element's style tag and write the CSS to make all h2 elements blue.\", \"With CSS, there are hundreds of CSS attributes that you can use to change the way an element looks on a web page.\", \"When you entered <h2 style=\"color: red\">CatPhotoApp<h2>, you were giving that individual h2 element an inline style\", \"When you entered <h2 style=\"color: red\">CatPhotoApp</h2>, you were giving that individual h2 element an inline style\", \"That's one way to add style to an element, but a better way is by using Cascading Style Sheets (CSS).\", \"At the top of your code, create a style tag like this: <style></style>\", \"Inside that style element, you can create a css selector for all h2 elements. For example, if you wanted all h2 elements to be red, your style element would look like this: <style>h2 {color: red;}</style>\","} +{"_id":"doc-en-freeCodeCamp-2bba4b191c1482912d3e6f1b87cdd9eaabe68ea4220dff572297c4ec8626f6f5","title":"","text":"\"Here's the anatomy of a CSS class:\", \"a diagram of how style tags are composed, which is also described in detail on the following lines.\", \"You can see that we've created a CSS class called \"blue-text\" within the <style> tag.\", \"You can apply a class to an HTML element like this: <h2 class=\"blue-text\">CatPhotoApp<h2>\", \"You can apply a class to an HTML element like this: <h2 class=\"blue-text\">CatPhotoApp</h2>\", \"Note that in your CSS style element, classes should start with a period. In your HTML elements' class declarations, classes shouldn't start with a period.\", \"Instead of creating a new Style tag, try removing the h2 style declaration from the existing style element, and replace it with the class declaration for \".red-text\".\" ],"} +{"_id":"doc-en-freeCodeCamp-eb3586ca7f06729ebd7567505c9341d8d112a4d7f126b0220e76fcdfad17535d","title":"","text":"\"description\": [ \"Wrap your img element inside an anchor element with a dead link.\", \"You can make elements into links by wrapping them in an anchor tag.\", \"Wrap your image in an anchor tag. Here's an example: <a href='#'><img src='http://bit.ly/fcc-kittens2'></a>\", \"Wrap your image in an anchor tag. Here's an example: <a href='#'><img src='http://bit.ly/fcc-kittens2'/></a>\", \"Remember to use the hash symbol as your anchor tag's href property in order to turn it into a dead link.\", \"Once you've done this, hover over your image with your cursor. Your cursor's normal pointer should become the link clicking pointer. The photo is now a link.\" ],"} +{"_id":"doc-en-freeCodeCamp-7dc921a4898aeb4b939e7bd8ea408cf27022840d87909e8da6cf8f6290e44c76","title":"","text":"\"Replace the paragraph elements with an unordered list of three things that cats love.\", \"HTML has a special element for creating unordered lists, or bullet point-style lists.\", \"Unordered lists start with a <ul> element. Then they contain some number of <li> elements.\", \"For example: <ul><li>milk</li><li>cheese</li><ul> would create a bulleted list of \"milk\" and \"cheese\".\" \"For example: <ul><li>milk</li><li>cheese</li></ul> would create a bulleted list of \"milk\" and \"cheese\".\" ], \"tests\": [ \"assert($('ul').length > 0, 'Create a ul element.')\","} +{"_id":"doc-en-freeCodeCamp-0e61b7241fb4fdc3fdc66112df916c9e03400dc690b7157b5bee3b55876b4dd7","title":"","text":"\"Create an ordered list of the the top 3 things cats hate the most.\", \"HTML has a special element for creating ordered lists, or numbered-style lists.\", \"Ordered lists start with a <ol> element. Then they contain some number of <li> elements.\", \"For example: <ol><li>hydrogen</li><li>helium</li><ol> would create a numbered list of \"hydrogen\" and \"helium\".\" \"For example: <ol><li>hydrogen</li><li>helium</li></ol> would create a numbered list of \"hydrogen\" and \"helium\".\" ], \"tests\": [ \"assert($('ul').length > 0, 'You should have an ul element on your webpage.')\","} +{"_id":"doc-en-freeCodeCamp-90eba81c49837951ab5edf319b39c16f23ab61b317f6c3690c1e868ba7a2edf8","title":"","text":"\"Hint: Here's an example call to Twitch.tv's JSON API: https://api.twitch.tv/kraken/streams/freecodecamp.\", \"Hint: The relevant documentation about this API call is here: https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel.\", \"Hint: Here's an array of the Twitch.tv usernames of people who regularly stream coding: [\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"comster404\",\"brunofin\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"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, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text\" ],"} +{"_id":"doc-en-freeCodeCamp-46d85b6621f358cd9c2996b9c52935a29e5afc2ac4a2e39aa25c0a71a4f4bb73","title":"","text":"\"Here are the user stories you must enable, and optional bonus user stories:\", \"User Story: As a user, I can click a button to show me a new random quote.\", \"Bonus User Story: As a user, I can press a button to tweet out a quote.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"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, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text\" ],"} +{"_id":"doc-en-freeCodeCamp-4b4337f17232203cb441522fe80c670ebbe9f523710908f9bc8a0b457a36ff1b","title":"","text":"\"Bonus User Story: As a user, I can see an icon depending on the temperature..\", \"Bonus User Story: As a user, I see a different background image depending on the temperature (e.g. snowy mountain, hot desert).\", \"Bonus User Story: As a user, I can push a button to toggle between Fahrenheit and Celsius.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"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, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text\" ],"} +{"_id":"doc-en-freeCodeCamp-d2e1516120ac28aee978dfdee95d49a0175502f823f1b4e4e067d958aec66d9b","title":"","text":"\"User Story: As a user, I can click a link to go directly to the post's discussion page.\", \"Bonus User Story: As a user, I can see how many upvotes each story has.\", \"Hint: Here's the Camper News Hot Stories API endpoint: http://www.freecodecamp.com/stories/hotStories.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"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, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text\" ],"} +{"_id":"doc-en-freeCodeCamp-0211ca8fd62b22bfdc2e31434e01671c4e4d52e5e762e6038f27e4f021ab8cb7","title":"","text":"\"Bonus User Story:As a user, I can click a button to see a random Wikipedia entry.\", \"Bonus User Story:As a user, when I type in the search box, I can see a dropdown menu with autocomplete options for matching Wikipedia entries.\", \"Hint: Here's an entry on using Wikipedia's API: http://www.mediawiki.org/wiki/API:Main_page.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.\", \"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, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text\" ],"} +{"_id":"doc-en-freeCodeCamp-c054adb2998deb7567614c9999d43445a746dc2b15437b8ac1a897b2791744ed","title":"","text":"], \"tests\": [ \"assert((/cat photos/gi).test($(\"a\").text()), 'Your a element should have the anchor text of \"cat photos\"')\", \"assert(/http://catphotoapp.com/gi.test($(\"a\").attr(\"href\")), 'You need an a element that links to http://catphotoapp.com.')\", \"assert(/http://catphotoapp.com/gi.test($(\"a\").attr(\"href\")), 'You need an a element that links to http://catphotoapp.com.')\", \"assert(editor.match(//g) && editor.match(//g).length === editor.match(/a element has a closing tag.')\" ], \"challengeSeed\": ["} +{"_id":"doc-en-freeCodeCamp-2bccdec5a21f4c9b2d30c18de106a3ebff69b12011c0a4084ae70b2bb52b41ab","title":"","text":"\"Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button.\", \"Click the \"Start Editing\" button.\", \"In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.\", \"Run this command: npm install how-to-npm -g\", \"Now start this tutorial by running npm install how-to-npm@2.0.0.\", \"Install how-to-npm with this command: npm install how-to-npm -g\", \"Now start the tutorial by running how-to-npm.\", \"Note that you can resize the c9.io's windows by dragging their borders.\", \"Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: cd ~/workspace.\", \"Note that you can only add dist tags to the specific version numbers published in steps 8 and 10. If you receive a 403 or 404 error, run how-to-npm and try again.\","} +{"_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-d1931b310166eeac7b3ab052e0740756c868a26bb59a2974d365cb0d2335dd92","title":"","text":"], \"tests\": [ \"assert($(\"body\").css(\"background-color\") === \"rgb(255, 0, 0)\", 'Give your body element the background-color of red.')\", \"assert(editor.match(/#FF0000/g) && editor.match(/#FF0000/g).length > 0, 'Use the hex code for the color red instead of the word red. For example body { color: #FF0000; }.')\" \"assert(editor.match(/#FF0000/ig) && editor.match(/#FF0000/ig).length > 0, 'Use the hex code for the color red instead of the word red. For example body { color: #FF0000; }.')\" ], \"challengeSeed\": [ \"\", \"\", \"

CatPhotoApp

\", \"\", \"\", \"
cat photos\", \"\", \"\", \"\", \"\", \"

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

\","} +{"_id":"doc-en-freeCodeCamp-e42a31f8b7dfe20f2fc3c516ee71dc5c54c4eb59b1d3eee25b95b4add8bb5051","title":"","text":"\"Let's delete the \"tails\" property from myDog.\" ], \"tests\": [ \"assert(myDog.bark === undefined, 'message: Delete the property \"bark\" from myDog.');\" \"assert(myDog.tails === undefined, 'message: Delete the property \"tails\" from myDog.');\" ], \"challengeSeed\": [ \"var ourDog = {\","} +{"_id":"doc-en-freeCodeCamp-2f7a4af3748b369d0ac6f643988a5afdd52b41411d2cc97530efc6e3dc078821","title":"","text":"[ \"http://i.imgur.com/EoTfOyC.jpg\", \"An image of some of our campers coding together in Montreal.\", \"Keep practicing coding every day and hanging out with other people who code, and you will becoming a job-ready coder.\", \"Keep practicing coding every day and hanging out with other people who code, and you will become a job-ready coder.\", \"\" ], ["} +{"_id":"doc-en-freeCodeCamp-0fccf35a056b615a835a6cda83e32e2cdae01e077fc6fee4bc4a725bb6e06414","title":"","text":"\"challenges\": [ { \"id\": \"bb000000000000000000001\", \"title\": \"Trigger Click Events with jQuery\", \"title\": \"Trigger Click Events with jQuery\", \"description\": [ \"In this section, we'll learn how to get data from APIs. APIs - or Application Programming Interfaces - are tools that computers use to communicate with one another.\", \"We'll also learn how to update HTML with the data we get from these APIs using a technology called Ajax.\","} +{"_id":"doc-en-freeCodeCamp-bb4554ac95afd64d8c6152637990369f08046a310d8efbcc80b280f7144586bf","title":"","text":"\"\" ], \"challengeType\": 0, \"type\": \"waypoint\" \"type\": \"waypoint\", \"nameEs\": \"Activa eventos de pulsación con jQuery\", \"descriptionEs\": [ \"En esta sección, vamos a aprender cómo obtener datos de las APIs. Las APIs - o interfaces de programación de aplicaciones - son herramientas que utilizan los computadores para comunicarse entre sí.\", \"También aprenderemos cómo actualizar HTML con los datos que obtenemos de estas API usando una tecnología llamada Ajax.\", \"En primer lugar, vamos a revisar lo que hace la función $(document).ready(). Esta función hace que todo el código dentro de ella se ejecute sólo hasta que nuestra página ha sido cargada.\", \"Hagamos que nuestro botón \"Get message\" cambie el texto del elemento con clase message.\", \"Antes de poder hacer esto, tenemos que implementar un evento de pulsación dentro de nuestra función $(document).ready(), añadiendo este código:\", \"$(\"#getMessage\").on(\"click\", function(){\", \"\", \"});\" ] }, { \"id\": \"bc000000000000000000001\", \"title\": \"Change Text with Click Events\", \"title\": \"Change Text with Click Events\", \"description\": [ \"When our click event happens, we can use Ajax to update an HTML element.\", \"Let's make it so that when a user clicks the \"Get Message\" button, we change the text of the element with the class message to say \"Here is the message\".\","} +{"_id":"doc-en-freeCodeCamp-327c031172ca46cb36aaeba77fc726adb3b98d5968b433639569b6e055b13270","title":"","text":"\"\" ], \"challengeType\": 0, \"type\": \"waypoint\" \"type\": \"waypoint\", \"nameEs\": \"Cambia texto con eventos de pulsación\", \"descriptionEs\": [ \"Cuando nuestro evento de pulsación ocurre, podemos utilizar Ajax para actualizar un elemento HTML.\", \"Hagamos que cuando un usuario pulse el botón \"Get Message\", el texto del elemento con la clase message cambie para decir \"Here is the message\".\", \"Podemos hacerlo añadiendo el siguiente código dentro de nuestro evento de pulsación:\", \"  $(\".message\").html(\"Here is the message\");\" ] }, { \"id\": \"bb000000000000000000002\","} +{"_id":"doc-en-freeCodeCamp-f2a6e82719c76947998deb3d20a40ae249bed70c4e4f512da8fa80f364e20405","title":"","text":"\"\" ], \"challengeType\": 0, \"type\": \"waypoint\" \"type\": \"waypoint\", \"nameEs\": \"Obtén JSON con el método getJSON de jQuery\", \"descriptionEs\": [ \"También puedes solicitar los datos de una fuente externa. Aquí es donde entran en juego las API. \", \"Recuerda que las API - o interfaces de programación de aplicaciones - son herramientas que utilizan los ordenadores para comunicarse entre sí.\", \"La mayoría de las API para el web transfieren datos en un formato llamado JSON. JSON significa notación de objeto JavaScript (JavaScript Object Notation).\", \"Tú ya has usado JSON al crear objetos en JavaScript. JSON no es más que las propiedades del objeto y sus valores actuales, intercalados entre un { y un }. \", \"Estas propiedades y sus valores a menudo se denominan \" pares llave-valor\".\", \"Vamos a obtener el JSON de la API de fotos de gato de Free Code Camp.\", \"Aquí está el código que puedes poner en tu evento de pulsación para lograrlo:\", \"  $.getJSON(\"/json/cats.json\", function(json) {\", \"    $(\".message\").html(JSON.stringify(json));\", \"  });\", \"Una vez lo añadas, pulsa el botón \"Get Message\". Su función Ajax sustituirá el texto \"The message will go here\" con la salida JSON en bruto de la API de fotos de gato de Free Code Camp.\" ] }, { \"id\": \"bb000000000000000000003\", \"title\": \"Convert JSON Data to HTML\", \"title\": \"Convert JSON Data to HTML\", \"description\": [ \"Now that we're getting data from a JSON API, let's display it in our HTML.\", \"We can use the .forEach() method to loop through our data and modify our HTML elements.\","} +{"_id":"doc-en-freeCodeCamp-18c652f55536cf76e3e554bf29965da877fa8663d855317da81dce7c32af11b0","title":"","text":"\" \", \"
\", \"
\", \" The message will go here\",\"
\", \" The message will go here\", \"
\", \" \", \"
\", \"
\","} +{"_id":"doc-en-freeCodeCamp-e256bd630af8f50565de730331d345e06cdf7611b8390d3a91cfcc28c682832f","title":"","text":"\"
\" ], \"challengeType\": 0, \"type\": \"waypoint\" \"type\": \"waypoint\", \"nameEs\": \"Convierte datos JSON a datos HTML\", \"descriptionEs\": [ \"Ahora que estamos obteniendo datos de una API JSON, mostremóslos en nuestro HTML.\", \"Podemos usar el método .forEach() para recorrer nuestros datos y modificar nuestros elementos HTML.\", \"En primer lugar, vamos a declarar una variable llamada html con var html = \"\";.\", \"Después, iteremos a traveś de nuestro JSON, añadiendo más HTML a esa variable. Cuando se termina el ciclo, vamos a presentarla. \", \"Aquí está el código que hace esto:\", \"json.forEach(function(val) {\", \"  var keys = Object.keys(val);\", \"  html += \"<div class = 'cat'>\";\", \"  keys.forEach(function(key) {\", \"    html += \"<b>\" + key + \"</b>: \" + val[key] + \"<br>\";\", \"  });\", \"  html += \"</div><br>\";\", \"});\" ] }, { \"id\": \"bb000000000000000000004\", \"title\": \"Render Images from Data Sources\", \"title\": \"Render Images from Data Sources\", \"description\": [ \"In the JSON that we receive data from Free Code Camp's Cat Photo API.\", \"We've seen from the last two lessons that each object in our JSON array contains an imageLink key with a value that is the url of a cat's image.\","} +{"_id":"doc-en-freeCodeCamp-1fda8203a0661b0d1f81e9b1e998957b2006500c104cf2cfaecb7db9b454529a","title":"","text":"\"
\" ], \"challengeType\": 0, \"type\": \"waypoint\" \"type\": \"waypoint\", \"nameEs\": \"Presentar imágenes de fuentes de datos\", \"descriptionEs\": [ \"Tanto en el JSON que recibimos de la API de fotos de gato de Free Code Camp, como en \", \"lo que hemos visto en las dos últimas lecciones, cada objeto en nuestro vector JSON contiene una llave imageLink con un valor que corresponde a la url de la imagen de un gato.\", \"Cuando estamos recorriendo estos objetos, usemos esta propiedad imageLink para visualizar la imagen en un elemento img.\", \"Aquí está el código que hace esto:\", \"  html += \"<img src = '\" + val.imageLink + \"'>\";\" ] }, { \"id\": \"bb000000000000000000005\", \"title\": \"Prefilter JSON\", \"title\": \"Prefilter JSON\", \"description\": [ \"If we don't want to render every cat photo we get from our Free Code Camp's Cat Photo JSON API, we can pre-filter the json before we loop through it.\", \"Let's filter out the cat who's \"id\" key has a value of 1.\","} +{"_id":"doc-en-freeCodeCamp-9ec5efc970042ac9fdaf9e353a849e6ed0f5159bd893d9b42f678d1a6690b7cd","title":"","text":"\"\" ], \"challengeType\": 0, \"type\": \"waypoint\" \"type\": \"waypoint\", \"nameEs\": \"Pre-filtra JSON\", \"descriptionEs\": [ \"Si no queremos presentar cada foto de gato que obtengamos de la API JSON de fotos de gato de Free Code Camp, podemos pre-filtrar el json antes de iterar a través de este.\", \"Vamos a filtrar el gato cuya llave \"id\" tiene un valor de 1.\", \"Aquí está el código para hacer esto:\", \"json = json.filter(function(val) {\", \"  return(val.id !== 1);\", \"});\" ] }, { \"id\": \"bb000000000000000000006\", \"title\": \"Get Geo-location Data\", \"title\": \"Get Geo-location Data\", \"description\": [ \"Another cool thing we can do is access our user's current location. Every browser has a built in navigator that can give us this information.\", \"The navigator will get our user's current longitude and latitude.\","} +{"_id":"doc-en-freeCodeCamp-64ba6aa95277cdebfe8c4feac5456c23af351015023ceb14151ea20c8a2e6fe6","title":"","text":"\"\" ], \"challengeType\": 0, \"type\": \"waypoint\" \"type\": \"waypoint\", \"nameEs\": \"Recibir datos de Geo-localización\", \"descriptionEs\": [ \"Otra cosa interesante que podemos hacer es acceder a la ubicación actual de nuestros usuarios. Todos los navegadores han incorporado un geo-localizador que nos puede dar esta información. \", \"El navegador puede obtener la longitud y latitud actual de nuestros usuarios.\", \"Como usuario verás un mensaje para permitir o evitar que el sitio conozca tu ubicación actual. El desafío se puede completar de cualquier manera, siempre y cuando el código sea correcto. \", \"Si lo permites, verás que el texto en el teléfono de la derecha cambiará con tu latitud y longitud\", \"Aquí hay un código que hace esto:\", \"if (navigator.geolocation) {\", \"  navigator.geolocation.getCurrentPosition(function(position) {\", \"    $(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);\", \"  });\", \"}\" ] } ] }"} +{"_id":"doc-en-freeCodeCamp-92d613b71ddf71dbede440a15d3d6f2d869646dd4ed9f3b6c6fe2373f19744c1","title":"","text":"\"assert(telephoneCheck(\"(555)555-5555\") === true, 'message: telephoneCheck(\"(555)555-5555\") should return true.');\", \"assert(telephoneCheck(\"1(555)555-5555\") === true, 'message: telephoneCheck(\"1(555)555-5555\") should return true.');\", \"assert(telephoneCheck(\"1 555 555 5555\") === true, 'message: telephoneCheck(\"1 555 555 5555\") should return true.');\", \"assert(telephoneCheck(\"555-555-5555\") === true, 'message: telephoneCheck(\"555-555-5555\") should return true.');\", \"assert(telephoneCheck(\"1 456 789 4444\") === true, 'message: telephoneCheck(\"1 456 789 4444\") should return true.');\", \"assert(telephoneCheck(\"123**&!!asdf#\") === false, 'message: telephoneCheck(\"123**&!!asdf#\") should return false.');\", \"assert(telephoneCheck(\"55555555\") === false, 'message: telephoneCheck(\"55555555\") should return false.');\","} +{"_id":"doc-en-freeCodeCamp-6603cbdef13febc30282d43428a6d5dcaffd0fd44a61978dd2f180655d88c062","title":"","text":"\"assert(telephoneCheck(\"(275)76227382\") === false, 'message: telephoneCheck(\"(275)76227382\") should return false.');\", \"assert(telephoneCheck(\"2(757)6227382\") === false, 'message: telephoneCheck(\"2(757)6227382\") should return false.');\", \"assert(telephoneCheck(\"2(757)622-7382\") === false, 'message: telephoneCheck(\"2(757)622-7382\") should return false.');\", \"assert(telephoneCheck(\"555)-555-5555\") === false, 'message: telephoneCheck(\"555)555-5555\") should return false.');\", \"assert(telephoneCheck(\"555)-555-5555\") === false, 'message: telephoneCheck(\"555)-555-5555\") should return false.');\", \"assert(telephoneCheck(\"(555-555-5555\") === false, 'message: telephoneCheck(\"(555-555-5555\") should return false.');\" ], \"challengeSeed\": ["} +{"_id":"doc-en-freeCodeCamp-e507857618e9d0a34fa58d3436225f66fdc8b4c1a9c1d9aa40e799efacf21f6a","title":"","text":"\"var b = 2;\", \"\", \"// Only change code below this line\", \" \" \"\" ], \"tail\": [ \"(function(a,b){return \"a = \" + a + \", b = \" + b;})(a,b);\""} +{"_id":"doc-en-freeCodeCamp-5b30a79fcbe90301f02cf6daa1dd2f6fbe9206582707f10262b2aa9bc58a9749","title":"","text":"\"description\": [ \"In Javascript, String values are immutable, which means that they cannot be altered once created.\", \"For example, the following code:\", \"
var myStr = \"Bob\";
myStr[0] = \"J\";
\",
\"
var myStr = \"Bob\";
myStr[0] = \"J\";
\",
\"cannot change the value of myStr to \"Job\", because the contents of myStr cannot be altered. Note that this does not mean that myStr cannot be changed, just that the individual characters of a string literal cannot be changed. The only way to change myStr would be to assign it with a new string, like this:\", \"
var myStr = \"Bob\";
myStr = \"Job\";
\",
\"
var myStr = \"Bob\";
myStr = \"Job\";
\",
\"

Instructions

\", \"Correct the assignment to myStr to achieve the desired effect.\" ],"} +{"_id":"doc-en-freeCodeCamp-c0ff368b8441be9d71ca9f7ff1a8d0002cdd3a0cf50fddc1e859073fd24fed4e","title":"","text":"\"description\": [ \"One way to think of a multi-dimensional array, is as an array of arrays. When you use brackets to access your array, the first set of bracket refers to the entries in the outer-most array, and each subsequent level of brackets refers to the next level of entries inside.\", \"Example\", \"
var arr = [
[1,2,3],
[4,5,6],
[7,8,9],
[[10,11,12], 13, 14]
];
arr[0]; // equals [1,2,3]
arr[1][2]; // equals 6
arr[3][0][1]; // equals 11
\",
\"
var arr = [
[1,2,3],
[4,5,6],
[7,8,9],
[[10,11,12], 13, 14]
];
arr[0]; // equals [1,2,3]
arr[1][2]; // equals 6
arr[3][0][1]; // equals 11
\",
\"

Instructions

\", \"Read from myArray using bracket notation so that myData is equal to 8\" ],"} +{"_id":"doc-en-freeCodeCamp-832820be50d8cd052de0bee7a5a90d66eb322b0a8ef2d9959b5e24e0a10934cd","title":"","text":"\"tests\": [], \"type\": \"waypoint\", \"challengeType\": 3, \"nameEs\": \"Crea una aplicación de votaciones\" \"nameEs\": \"Desafios para aprender D3\", \"descriptionEs\": [] } ] }"} +{"_id":"doc-en-freeCodeCamp-41970edebd08a44def58b5e495298a8ce448d2ca0e73d76ee4f4b7db2e5aa57f","title":"","text":"\"tests\": [], \"type\": \"waypoint\", \"challengeType\": 3, \"nameEs\": \"Crea una aplicación de votaciones\" \"nameEs\": \"Desafios para aprender React\", \"descriptionEs\": [] } ] }"} +{"_id":"doc-en-freeCodeCamp-9272ab315bd773e08ee2547dee88634645aa12fd24e28cd3b557ad9f585da68d","title":"","text":"\"tests\": [], \"type\": \"waypoint\", \"challengeType\": 3, \"nameEs\": \"Crea una aplicación de votaciones\" \"nameEs\": \"Desafios para aprender Sass\", \"descriptionEs\": [] } ] }"} +{"_id":"doc-en-freeCodeCamp-06283b3dfc6f24122db6499282b4e744f69f6987ad7eb5ca70f419a8806ea565","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: MDN y Documentación\", \"descriptionEs\": [ \"Esta es una introducción básica a MDN y el concepto de la documentación.\", \"MDN, Mozilla Developer Network, es una fantástica colaboración de fuentes abiertas que documenta no sólo JavaScript, sino muchos otros lenguajes y temas. Si no has oído hablar de ellos, deberías darles un vistazo ahora. Personalmente obtengo mucha información de developer.mozilla.org/en-US/docs/Web/JavaScript \", \"Cuando digo documentación, estoy hablando acerca de la información que se proporciona sobre el producto a sus usuarios. La documentación de MDN no necesariamente está escrita por la gente detrás de JS. Brendan Eich creó JS en 1995, pero hoy en día el proyecto continúa creciendo gracias a un esfuerzo comunitario. \", \"A medida que continúes aprendiendo JavaScript, jQuery, y prácticamente cualquier otro lenguaje o servicio para desarrollo o programación, la documentación será tu amiga.\", \"Cuanto más rápido te sientas cómodo leyendo y referenciando documentación, más rápido crecerás como desarrollador.\", \"Estos vídeos no van a enseñarte JavaScript - te presentan términos y conceptos que serán valiosos a medida que continúes practicando y aprendiendo.\" ] }, { \"id\": \"56b15f15632298c12f31518d\","} +{"_id":"doc-en-freeCodeCamp-313398a55431ea07bd4078ac5d8fa7b8617f92ea3806eacf3a4aaa8056616fe3","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: Tipos de valores\", \"descriptionEs\": [ \"Aprende sobre los tres tipos más básicos de valores: Booleanos, cadenas y números\", \"Un booleano es un valor true (verdadero) o false (falso). Estas palabras son especiales y reservadas. No puedes nombrar a una variable como \"true\", porque esa palabra es ya universal como un valor lógico (así como lo es \"false\"). \", \"Una cadena es un conjunto de caracteres que se establecen entre apóstrofes (') o entre comillas (\"). Una cadena puede ser \"true\", siempre y cuando sea con comillas o con apóstrofes. \", \"Los números se explican por sí mismos - un número es un valor que se compone sólo de dígitos, aunque también puede contener un decimal o un signo negativo.\" ] }, { \"id\": \"56b15f15632298c12f31518b\","} +{"_id":"doc-en-freeCodeCamp-1c3cbc498bf7d4ae3acf527dd2fbd661ba6c360a1bc78ca3673a86a27a9f29c4","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: Variables y capitalizaciónCamello\", \"descriptionEs\": [ \"Vamos a cubrir lo que constituye una variable, y el razonamiento detrás de la capitalizaciónCamello (camelCase).\", \"Una variable, también conocida como una 'var', es el nombre o el espacio para un booleano, una cadena, un número, u otra pieza de información estática.\", \"Puedes usar las Herramientas de desarrollo de Google para inspeccionar la página principal de FreeCodeCamp y buscar algunas variables.\", \"Tu 'declaras' variables por primera vez con var en frente de ella, pero después puedes referenciarla más adelante en tu programa.\", \"capitalizaciónCamello es una forma en la que juntas varias palabras y aún así las mantienes legibles. La primera letra de la primera palabra va en minúsculas al igual que el resto de la primera palabra, pero la primera letra de cada palabra que siga se escribe en mayúsculas. No hay espacios. Ejemplos: brianaAmaSusMascotas, laMejorComidaEsElQueso, y valeLaPenaAprenderProgramacion.\", \"Al asignar un nombre de variable, usa capitalizaciónCamello. Además, trata de mantener los nombres descriptivos y cortos para que los demás (¡e incluso tu!) puedan entender a lo que se refiere la variable simplemente por el nombre.\" ] }, { \"id\": \"56b15f15632298c12f31518a\","} +{"_id":"doc-en-freeCodeCamp-893da5d53396e97bb82003655d88035d89d36094a705162d23a9c872c78f24a8","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: Vectores y objetos\", \"descriptionEs\": [ \"Si desea almacenar más de una pieza de información en una variable, puedes hacerlo mediante la creación de un vector o de un objeto.\", \"** Exención de responsabilidad: Los objetos de JS no son exactamente lo mismo que los objetos en otros lenguajes. Vamos a discutir aquí objetos con respecto a JS. \", \"Los vectores son conjuntos de valores entre [corchetes]. Los valores se separan con comas. Cada valor puede ser booleano, cadena, número, o incluso otro vector. A esto último le llamamos vector anidado. A un vector compuesto por vectores de la misma longitud le llamamos matriz. \", \"Los objetos son un tipo de datos que pueden verse o comportarse como un vector, en la medida que se trata de más valores almacenados en una variable de una manera organizada. Oirás que un objeto se puede representar en JSON, y con frecuencia cuando haces llamadas a la API de algunos sitios (para obtener información que necesitas mostrar en tu propia página) está será devuelta en JSON. \", \"Un ejemplo de la notación de objetos es: var obj = { 'nombre': 'Briana', 'comida': 'queso', 'perro': 'Maurice'};\", \"Fíjate que un objeto se encierra entre llaves { ... }, que los diferentes atributos se separan por comas, que cada atributo consta de una palabra llave y de un valor. Por ejemplo son llaves 'nombre', 'comida' y 'perro' y sus respectivos valores son 'Briana', 'queso' y 'Maurice'. En este ejmplo todos los valores fueron cadenas, aunque también son válidos booleanos, números y otros tipos de datos.\" ] }, { \"id\": \"56b15f15632298c12f315189\","} +{"_id":"doc-en-freeCodeCamp-57c5e0638fc0c1e2929b6e279699b086e3cc8e6e05e3aade064f53d3e311aa77","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: Encontrando e indexando valores en vectores\", \"descriptionEs\": [ \"Hay muchas razones por las que puedes necesitar acceder a una determinada pieza de información al interior de un conjunto más amplio, lo cual haces referenciando su índice.\", \"No vamos a entrar en la sintaxis, pero debes saber que el primer elemento en un vector tiene en realidad el índice 0.\", \"Esto también aplica para cadenas y objetos. Todos estos índices comienzan en 0, por lo que si en tu programa usas miVector[2], realmente vas a obtener la tercera pieza de información del vector miVector.\" ] }, { \"id\": \"56b15f15632298c12f315188\","} +{"_id":"doc-en-freeCodeCamp-901c9ba944d1ff4d4cdd3f56455445e2842c37fca2c1d8939ebbe93eafe88a46","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: Manipulación de los datos\", \"descriptionEs\": [ \"Métodos y funciones son formas con las que puedes modificar variables u otros conjuntos de información.\", \"Los métodos están integrados en JavaScript, y te familiarizarás con estos cuando realices los desafíos sobre algoritmos.\", \"Me gustaría sugerirte dar un vistazo a MDN (Mozilla Developer Network que discutimos en el primer video) para que te familiarices con la cantidad y el potencial general de los métodos que existen. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Methods_Index\", \"Los ejemplos incluyen .split (' '), que convertirá una cadena en un vector y puede hacerlo de muchas maneras diferentes. Los métodos son de gran alcance - muchas veces cuando quieres que tu programa haga algo, ya habrá un método para eso.\", \"Las funciones, al igual que las variables, son algo que tu defines y creas.\", \"Durante tu práctica con algoritmos en FreeCodeCamp, vas a crear funciones que reciben una determinada pieza de información y la manipulan de la forma que elijas.\", \"Vas a estar más familiarizado con la sintaxis, pero por ahora, sólo recuerda que con los métodos y funciones puedes hacer casi cualquier cosa con tu código.\" ] }, { \"id\": \"56b15f15632298c12f315187\","} +{"_id":"doc-en-freeCodeCamp-3ca895bc72a6121b323ce1394fd66059b886c57e0a58b1f1d877e16fd642d628","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: Matemáticas\", \"descriptionEs\": [ \"Hay un objeto estático de nombre 'Math' en JS con muchos propiedades y métodos incluidos.\", \"Vas a querer investigar más de este cuando manipules números. Consulta la documentación de MDN antes de escribir tus propias funciones, pues ya podrían estar definidas allí. \", \"Los ejemplos incluyen Math.random() que devolverá un número aleatorio en un rango y Math.round() que redondeará el número decimal que reciba al entero más cercano.\", \"Yo utilicé Math.random() cuando construí el generador de citas aleatorias como proyecto de desarrollo de interfaces en FreeCodeCamp.\", \"Cuando trabajes con números, también debes estar consciente de que JS tiene un atributo interesante llamado 'formato de coma flotante'.\", \"Dependiendo de la cantidad de números, su tamaño y la cantidad de cálculos, JS puede devolver un número que es inexacto en 0,00004.\", \"Hay maneras de evitar esto, y en general no plantean problemas, pero es algo que debes tener en cuenta si te encuentras con algunos problemas que parecen no tienen sentido.\" ] }, { \"id\": \"56b15f15632298c12f315186\","} +{"_id":"doc-en-freeCodeCamp-9630901adcbfd2eb9b5fc044738b97809554ab4e29bd9d679defa62a0abf0fc2","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"nameEs\": \"JavaScript Lingo: Ciclos\", \"descriptionEs\": [ \"Si hay un conjunto de valores (vamos a utilizar un vector en este ejemplo, pero no tiene que ser así) y deseas realizar la misma operación a cada valor del conjunto, puedes usar algo llamado ciclo. \", \"Los ciclos tienen una sintaxis compleja a la que inicialmente es difícil acostumbrarse, pero una vez que la entiendas, son de gran utilidad. Yo usé ciclos en muchas de mis soluciones. \", \"No es necesario que entiendas todo aquí - sólo que sepas que existen ciclos cuando necesitas recorrer un conjunto de datos y que pueden reducir la cantidad de código que debes escribir.\" ] }, { \"id\": \"56b15f15632298c12f315185\","} +{"_id":"doc-en-freeCodeCamp-aca49f4599327da818c3bc59dd4dc20b60b9614483a79f8daf01784c06715906","title":"","text":"] ], \"type\": \"hike\", \"challengeType\": 6 \"challengeType\": 6, \"id\": \"56b15f15632298c12f315185\", \"nameEs\": \"JavaScript Lingo: expresiones regulares (RegExp)\", \"descriptionEs\": [ \"Las RegExp no siguen el formato del resto de JS, y pueden requerir una curva de aprendizaje.\", \"Las epresiones regulares (abreviado RegExp) también pueden ser una herramienta muy útil y eficiente.\", \"Usando RegExp, puedes hacer coincidir, reemplazar, buscar y dividir una cadena, uno de los tipos más difíciles de manipular.\", \"Al igual que con todos los otros videos, no vamos a entrar en detalles, pero quiero mostrar algunos ejemplos donde las RegExp son útiles.\", \"Si quisieras crear una página de registro que verifique las contraseñas para que contengan al menos un número y una letra mayúscula, puedes usar expresiones regulares.\", \"Si quieres asegurarte de que las fechas introducidas en una página sean todas fechas válidas en el futuro, puedes usar RegExp.\", \"Si bien hay infinitas maneras de utilizar RegExp, muchas de estas incluyen validaciones o ediciones automáticas de información.\" ] } ] }"} +{"_id":"doc-en-freeCodeCamp-95eb4f40371e0014f7bc00a4026ca99c6f8653bcc573c8c63f6077fa4fe95919","title":"","text":"\"name\": \"Sorted Union\", \"difficulty\": \"2.07\", \"description\": [ \"Write a function that takes two or more arrays and returns a new array of unique values sorted in order.\" \"Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.\", \"The unique numbers should be sorted by their original order, but the final array should not be sorted in numerical order.\", \"Check the assertion tests for examples.\" ], \"challengeSeed\": \"function unite(arr) {n return arr;rn}nnunite([1, 2, 3], [5, 2, 1, 4], [2, 1]);\", \"tests\": ["} +{"_id":"doc-en-freeCodeCamp-299ca523c247f5041d3b45215411a62a8abf584c0a47b2d5315fc91d7d880646","title":"","text":"\"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']]);\" ] } ] No newline at end of file ] "} +{"_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-9f290a03ad141070c810b9720a1b537f3c7260c5b60e71e4b59667c4b3ed31ca","title":"","text":"\"The next option for the CSS position property is absolute, which locks the element in place relative to its parent container. Unlike the relative position, this removes the element from the normal flow of the document, so surrounding items ignore it. The CSS offset properties (top or bottom and left or right) are used to adjust the position.\", \"One nuance with absolute positioning is that it will be locked relative to its closest positioned ancestor. If you forget to add a position rule to the parent item, (this is typically done using position: relative;), the browser will keep looking up the chain and ultimately default to the body tag.\", \"
\", \"Lock the #searchbar element to the top-right of its section parent by declaring its position as absolute. Give it top and right offsets of 0.5 pixels each.\" \"Lock the #searchbar element to the top-right of its section parent by declaring its position as absolute. Give it top and right offsets of 50 pixels each.\" ], \"challengeSeed\": [ \" ``` "} +{"_id":"doc-en-freeCodeCamp-450ae51feac6069cad87f9b0e7a9563b6735d9515c8a4c62821c444b204930c7","title":"","text":" # Contribution Guidelines # Como trabajar con correos salientes localmente (para el flujo de trabajo de correo electrónico) Hello 👋 ! > **Nota:** Hay un **Opcional** Paso - Solo es requerido cuando trabajamos con el cuando se trabaja con flujos de trabajo de correo electrónico These instructions have not been translated yet. Please check this issue for details: [`#18312`](https://github.com/freeCodeCamp/freeCodeCamp/issues/18312) No newline at end of file ## Introducción Algunos flujos de trabajo del correo electrónico, como la actualizar el correo electrónico de un usuario, requieren de una API, en el backend para mandar correos electrónicos. mientras desarrollamos podemos usar una herramienta para obtenerlos localmente, en lugar de tener que usar un proveedor de correo electrónico y enviar un correo electrónico real. MailHog es una de las muchas herramientas de email para probar en el entorno de desarrollo para desarrolladores, que capturará los correos electrónicos de su instancia local que freeCodeCamp está enviando. ## Instalando MailHog Como podemons instalar y usar MailHog depende del sistema operativo - [Instalando MailHog en macOS](#installing-mailhog-on-macos) - [Instalando MailHog en Windows](#installing-mailhog-on-windows) - [Instalando MailHog en Linux](#installing-mailhog-on-linux) ### Instalando MailHog en MacOS Aquí podemos ver como instalar MailHog en macOS [Homebrew](https://brew.sh/): ``` bash brew install mailhog brew services start mailhog ``` Esto emepezara un servicio de mailHog en segundo plano. Siguiente, puedes ir a [using MailHog](#using-mailhog). ### Instalar MailHog en Windows Descarga la versión mas reciente de MailHog de [MailHog's official repository](https://github.com/mailhog/MailHog/releases). Click en el link dependiendo de tu versión de Windows (32 ó 64 bit) y el archivo .exe será descargado en tu computadora. Una vez que termine la descarga, haga clic en el archivo. Probablemente recibirá una notificación de firewall de Windows donde tendrá que permitir el acceso a MailHog. Una vez que lo haga, se abrirá una línea de comando estándar de Windows con MailHog ya en ejecución. Para cerrar MailHog, cierre el símbolo del sistema. Para volver a ejecutarlo, haga clic en el mismo archivo .exe. No necesitas descargar uno nuevo. Siguiente, Puedes ir a [using MailHog](#using-mailhog). ### Instalando MailHog en Linux Primero instalar [Go](https://golang.org). Para sistemas basados en Debian como Ubuntu y Linux Mint, en la terminal: ``` bash sudo apt-get install golang ``` Para CentOS, Fedora, Red Hat Linux, y otros sistemas basados en RPM-based, en la terminal: ``` bash sudo dnf install golang ``` O: ``` bash sudo yum install golang ``` Establecer path para Go: ``` bash echo \"export GOPATH=$HOME/go\" >> ~/.profile echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.profile source ~/.profile ``` Despues instalar y correr MailHog: ``` bash go get github.com/mailhog/MailHog sudo cp /home/$(whoami)/go/bin/MailHog /usr/local/bin/mailhog mailhog ``` Siguiente, Puedes ir a [using MailHog](#using-mailhog). ## Using MailHog ## Usando MailHog Una vez que hayas instalado MailHog y lo hayas iniciado, debes abrir tu bandeja de entrada de MailHog en tu navegador, y abre una nueva pestaña o ventana y navegar a [http://localhost:8025] (http://localhost:8025). Ahora debería ver una pantalla como la siguiente: ![MailHog Screenshot 1](images/mailhog/1.jpg) Cuando la instalación de freeCodeCamp envíe un correo electrónico, verás que aparece aquí. Como aquí abajo: ![MailHog Screenshot 2](images/mailhog/2.jpg) Abre el correo y verás dos pestañas donde puedes ver el contenido: texto sin formato y fuente. Asegúrate de que estás en la pestaña de texto sin formato. ![MailHog Screenshot 3](images/mailhog/3.jpg) Cualquier enlace en el correo electrónico debe ser seleccionable. ## Enlaces útiles - Para cualquier otra pregunta relacionada con MailHog o para obtener instrucciones sobre configuraciones personalizadas, consulte el repositorio [MailHog] (https://github.com/mailhog/MailHog). No newline at end of file"} +{"_id":"doc-en-freeCodeCamp-809944fb91618bf8234adb158f2b9c1088f452afcf56fd43f428fab86e9f6326","title":"","text":"Puedes realizar los cambios sin tener que ejecutar nada desde tu sistema local. Después de que encuentres el archivo que quieras modificar desde la interfaz de GitHub, haz clic en el icono de lápiz para comenzar a editar el archivo. Esto automáticamente creara una bifurcación del proyecto, si es que no tienes una todavía. Después de que encuentres el archivo que quieras modificar desde la interfaz de GitHub, hace clic en el icono de lápiz para comenzar a editar el archivo. Esto automáticamente creara una bifurcación del proyecto, si es que no tienes una todavía. También puedes clonar el proyecto y editarlo de manera local en tu ordenador. Si necesitas ayuda al respecto, dale un vistazo a la [guía principal de contribución](/CONTRIBUTING.md). ### Patrón de los Desafíos. He aquí un patrón de cómo se verán los archivos markdown correspondientes a los desafíos. He aquí un patrón de cómo se verán los archivos reduccion correspondientes a los desafíos. ````md ---"} +{"_id":"doc-en-freeCodeCamp-54a05d60b9d5f67ecec8de42009949d6f70bd10b1a8209cf575af8be56ad808b","title":"","text":"## Descripción
Una descripción del desafío y de los requerimientos aprobatorios Una descripción del desafío y de los requisitos aprobacion
## Instrucciones"} +{"_id":"doc-en-freeCodeCamp-8b5eb6af383951610ce193bcdd9189a36765972fc0f78ecd82d6f001b7519bbd","title":"","text":"Puedes: - [Ayudarnos creando y editando artúclos de la Guía](#steps-for-creating-and-editing-guide-articles). - [Ayudarnos creando y editando articulos de la Guía](#steps-for-creating-and-editing-guide-articles). - [Ayudarnos a revisar Pull Requests para artículos de la guía]() ## Pasos para crear y editar artículos de la Guía 1. 🍴 [Fork este repositorio](https://github.com/freeCodeCamp/freeCodeCamp#fork-destination-box) 2. 👀️ Sgiue las normas de controbución expuestas a continuación. 3. 🔧 Propón cambios asombrosos! 2. 👀️ Sigue las normas de contribución expuestas a continuación. 3. 🔧 Propóne cambios asombrosos! 4. 📖 Lee la [guía de buenas prácticas de estilo](/docs/style-guide-for-guide-articles). 5. 👉 [Haz una Pull Request](https://github.com/freeCodeCamp/freeCodeCamp/compare) 5. 👉 [Hace un Pull Request](https://github.com/freeCodeCamp/freeCodeCamp/compare) 6. 🎉 Consigue que aprueben tu Pull request - Éxito! O siemplement [crea un tema](https://github.com/freeCodeCamp/freeCodeCamp/issues) - toda pequeña ayuda cuenta! 😊 O simplemente [crea un tema](https://github.com/freeCodeCamp/freeCodeCamp/issues) - toda pequeña ayuda cuenta! 😊 ### [Sigue estas recomendaciones de nuestra guía de estilo para crear un artículo atractivo](/docs/style-guide-for-guide-articles.md) ### Crear Pull Request para propoenr cambios ### Crear Pull Request para proponer cambios Hay dos formas de proponer cambios en el repositorio tras editar o añadir un articulo: Hay dos formas de proponer cambios en el repositorio despues de editar o añadir un articulo: - [Utilizando la interfaz de GitHub en tu navegador](#using-the-github-web-interface-on-your-browser). - [Trabajando en tu ordenador personal](#working-on-your-local-machine) (_recomendado_ para previsualiar cambios). - [Utilizando el sistema de comunicacion de GitHub en tu navegador](#using-the-github-web-interface-on-your-browser). - [Trabajando en tu maquina local](#working-on-your-local-machine) (_recomendado_ para pre-visualiar cambios). #### Utilizar la interaz web de GitHub #### Utilizar el sistema de comunicacion web de GitHub Mira este vídeo de demostración o sigue los siguientes pasos: **[TODO]** Update the GIF recording. **[TODO]** Actualizar la grabacion GIF. ![GIF showing the GitHub interface steps](#) ![GIF mostrando los pasos de la interfaz de GitHub](#) 1. Ve a la carpets **\"páginas\"** (situado en [`guide`](/guide)) donde encontrarás el artículo raiz que quieras editar. 1. Ve a las carpetas **\"páginas\"** (situado en [`guide`](/guide)) donde encontrarás el artículo raiz que quieras editar. > Todas las raíces estarán en un archivo index.md 2. Pincha en Editar este archivo y haz tus cambios al archivo en la consola de edición de GitHub. 2. Pincha en Editar este archivo y hace tus cambios al archivo en la consola de edición de GitHub. > Si el icono aparece gris y te muestra la alerta \"Debes estar en una rama para hacer o proponer cambios a este archivo\", significa que probablemente estés en la rama de otra persona. En la parte superior izquierda de la página hay una casilla desplegable que dice: \"Árbol: #######\". Pincha en el desplegable y cambia la rama a maestra. El icono de edición debería estar disponible ahora."} +{"_id":"doc-en-freeCodeCamp-cc2baa30bab3df9ffdeb5013068b5806343a535d633cba374b1a7d9197ad8b60","title":"","text":"Documentos: Actualizadas recomendaciones de contribución ``` Se breve, no más de 50 caracteres. Puedes añadir información extra en la descripción del mensaje. Sea breve, no más de 50 caracteres. Puedes añadir información extra en la descripción del mensaje. esto no supone ningún esfuerzo adicional respecto a mensajes como 'update file' o 'add index.md'"} +{"_id":"doc-en-freeCodeCamp-79ed061ff482f71ca575c39f6b501ad75ad90a153f7f58049ea77ca4970283ea","title":"","text":"5. En la siguiente pantalla, puedes añadir más detalles sobre tu PR, luego pincha en Crear pull request. Enhorabuena 🎉! Acabas de crear una pull request. Felicidades 🎉! Acabas de crear un pull request. #### Trabajar desde tu sistema local (_recomendado_ para revisar cambios) No es obligatorio que trabajes en tu sistema personal, salvo que desees previsualizar tus cambios, o trabajar con mejoras y arreglos de UI. También es recomendable si tienes problemas con git como errores de integración, rebase, etc. No es obligatorio que trabajes en tu sistema personal, salvo que desees pre-visualizar tus cambios, o trabajar con version actualizada y arreglos de UI. También es recomendable si tienes problemas con git como errores de integración, rebase, etc. ##### Lee sobre esta recomendaciones en [Cómo configurar freeCodeCamp localmente](/docs/how-to-setup-freecodecamp-locally.md) ##### Lee sobre estas recomendaciones en [Cómo configurar freeCodeCamp localmente](/docs/how-to-setup-freecodecamp-locally.md) ### Aceptación de la PR Estas son algunos criterios utilizados por los revisores cuando evalúan PRs: Estos son algunos criterios utilizados por los criticos cuando evalúan PRs: - Descripción y título relevantes - La PR respeta la [guía de estilo](/docs/style-guide-for-guide-articles) - Consejos generales de QA de las [recomendaciones para Moderadores](https://forum.freecodecamp.org/t/freecodecamp-moderator-guidelines/18295) - Siempre y cuando la PR suponga una mejora o ampliación de la guía, será aceptada aunque tenga errores gramaticales o contenido parcial - Siempre y cuando el PR suponga una mejora o ampliación de la guía, será aceptado aunque tenga errores gramaticos o contenido parcial - Las PR más antiguas se revisan primero #### Etiquetas - **contenido** es para Pull Requests que modifican el contenido de artículos en la guía (añaden un nuevo artículo o actualizan uno existente) - **duplicada** es para Pull Request que contienen el mismo contenido que otra PR abierta - **cambios solicitados** es para Pull Requests que necesitan algún cambio antes de ser integradas - **pasada** es para Pull Requests que con etiqueta _\"changes requested\"_ que no han tenido actividad durante al menos 2 semanas y serán por tanto cerradas - Una pull request _pasada_ debe cerrarse. - **duplicada** es para Pull Request que contienen el mismo contenido que otro PR abierto - **cambios solicitados** es para Pull Requests que necesitan algún cambio antes de ser integrados - **pasada** es para Pull Requests que con etiqueta _\"changes requested\"_ que no han tenido actividad durante al menos 2 semanas y serán por tanto cerrados - Un pull request _pasado_ debe cerrarse. - Este es [un ejemplo](https://github.com/freeCodeCamp/freeCodeCamp/pull/235). #### Contenido conflictivo/duplicado Se considera **duplicada** una PR si hace cambios al mismo artículo que otra PR. Se considera **duplicado** un PR si hace cambios al mismo artículo que otro PR. En general el revisor: 1. Organizará las PR desde la más antigua 1. Organizará los PR desde lo más antiguo 2. Buscará para PRs con contenido similar 3. Integrará desde la más antigua a las más nueva 3. Integrará desde lo más antiguo a los más nuevos Muy probablemente aparecerán conflictos al integrar PRs duplicadas. Muy probablemente aparecerán conflictos al integrar PRs duplicados. Los revisores harán todos los esfuerzos posibles para resolver estos conflictos e integrar las PRs. Los revisores harán todos los esfuerzos posibles para resolver estos conflictos e integrar los PRs. #### Solicitar cambios Si la Pull Request no es perfect el revisor podría: Si el Pull Request no es perfecto el revisor podría: - solicitar cambios al contribuidor y añadir la etiqueta *cambios solicitados* - solucionar errores menores y hacer un envío encima de la PR - solucionar errores menores y hacer un envío encima de el PR #### Travis CI Build Todas las PRs deben superar los test de Travis CI antes de poder ser integradas. Todos los PRs deben superar los test de Travis CI antes de poder ser integrados. Si una PR rompe la ejecución (un test de Travis CI falla y muestra una \"X\" roja) hay tres cauas probables y tendrás que resolver el problemas antes de que podamos integrar la PR: Si un PR rompe la ejecución (un test de Travis CI falla y muestra una \"X\" roja) hay tres causas probables y tendrás que resolver el problema antes de que podamos integrar el PR: 1. Tu PR crea un nueva artículo pero la falta un archivo `index.md` en algún lugar. 1. Tu PR crea un nuevo artículo pero le falta un archivo `index.md` en algún lugar. - Cada directorio en `src/pages` necesita un archivo `index.md` en él (y debe llamarse `index.md`). - Dos escenarios muy probables son - llamaste al archivo de forma distinta a `index.md`, o"} +{"_id":"doc-en-freeCodeCamp-143145a27ba2f7762b2c6dc85600400b42bf139d0b1afcaf22d4bb9f36212886","title":"","text":" | [Read these guidelines in other languages](/docs/i18n-languages) | |-| # Как создать Pull Request (Пулл Реквест) ## Как сделать хороший заголовок для Pull Request: Создавая Pull Request (PR), воспользуйтесь данной таблицей, чтобы решить, как правильно озаглавить PR в формате: `fix/feat/chore/refactor/docs/perf (scope): PR Title` Например: `fix(learn): Fixed tests for the do...while loop challenge`. | Область | Описание | |---|---| | `learn`,`curriculum` | Для PR'ов, которые вносят изменения в учебный план. | | `client` | Для PR'ов, которые вносят изменения в логику клиентской платформы или пользовательский интерфейс. | | `guide` | Для PR'ов, которые вносят изменения в инстукции. | | `docs` | Для PR'ов, которые вносят изменения в документацию. | ## Создание Пулл Реквеста (PR) 1. После того, как вы внесёте какие-нибудь изменения в свой форк репозитория, GitHub предложит вам создать PR ![Изображение - Предложение о создании PR](/docs/images/github/compare-pull-request-prompt.png) 2. По умолчанию все PR создаются в ветку `master` основного репозитория freeCodeCamp При создании PR, убедитесь, что в поле \"base fork\" указан репозиторий freeCodeCamp/freeCodeCamp ![Изображение - Сравнение форков при создании PR](/docs/images/github/comparing-forks-for-pull-request.png) 3. Нажать на кнопку \"Create pull request\", для создания PR из вашей верки в ветку `master` freeCodeCamp. 4. В поле описания PR добавьте более подробный отчёт сделанных вами изменений и причины по которым появилась такая необходимость - Вам будет предоставлен шаблон, который содержит контрольные список пунктов, которые вам необходимо выполнить, прежде чем вы создадите PR. - Заполните эти пункты. Опираясь на них, будет приниматься решение о рассмотрении и принятии вашего PR - Если PR предназначен для исправления существующей ошибки/проблемы, то в конце описание вашего PR добавьте ключевое слово `closes` и #xxxx (где xxxx это номер выпуска). Например: `closes #1337`. Так GitHub поймёт, что при успешном принятии PR нужно автоматически закрыть Issue с указанным номером 5. Укажите, тестировали ли вы локальную копию сайта или нет. Тестирование необходимо, когда вы не просто меняете какой-то текст (например, статью руководства), а изменяете JavaScript, HTML или CSS файлы, которые могут изменить функциональность или макет страницы. "} +{"_id":"doc-en-freeCodeCamp-0508ba0f2c506e36022f4986b3beada42c74c2a59fb7eb0f4101efab9fa020ac","title":"","text":" --- title: Use the d3.max and d3.min Functions to Find Minimum and Maximum Values in a Dataset --- ## Use the d3.max and d3.min Functions to Find Minimum and Maximum Values in a Dataset This is a stub. Help our community expand it. This quick style guide will help ensure your pull request gets accepted. "} +{"_id":"doc-en-freeCodeCamp-4666b14317be9fc5a1fd58e64d92d476f3c9442ee4b3c400416512268f025e2f","title":"","text":" --- title: Use the d3.max and d3.min Functions to Find Minimum and Maximum Values in a Dataset --- ## Use the d3.max and d3.min Functions to Find Minimum and Maximum Values in a Dataset This is a stub. Help our community expand it. This quick style guide will help ensure your pull request gets accepted. "} +{"_id":"doc-en-freeCodeCamp-d20266f7abbf07fae19c03b9e7b710be2a2ecc1286ec769bb8b40c83a67935df","title":"","text":"The `
` tag is a container which is used for navigational links or introductory content. It may typically include heading elements, such as `

`, `

`, but may also include other elements such as a search form, logo, author information etc.

corresponds to the most important heading. As we move to other tags like

,

, etc the degree of importance decreases. `

` corresponds to the most important heading. As we move to other tags like `

`, `

`, etc the degree of importance decreases. Although not required, the `
` tag is intended to contain the surrounding sections heading. It may also be used more than once in an HTML document. It is important to note that the `
` tag does not introduce a new section, but is simply the head of a section. Here's an example using the `
` tag:"} +{"_id":"doc-en-freeCodeCamp-78710fd0b725d4b53c7069cf2c1e43c04581df843ccbe0f9c447a2cffc2da5f1","title":"","text":"- text: No global myVar variable testString: assert(typeof myVar === 'undefined', 'No global myVar variable'); - text: Add a local myVar variable testString: assert(/vars+myVar/.test(code), 'Add a local myVar variable'); testString: assert(/functions+myLocalScopes*(s*)s*{s[sS]+s*vars*myVars*(s*|=[sS]+)s*;[sS]+}/.test(code), 'Add a local myVar variable'); ```"} +{"_id":"doc-en-freeCodeCamp-5bb0d79bc428b808a6ee9dceffb1bc5f5ac0d7cd85e48149c141dc8b3fb3aea2","title":"","text":"import React from 'react'; import { Link as GatsbyLink } from 'gatsby'; import { Grid, Row, Col } from '@freecodecamp/react-bootstrap'; import FontAwesomeIcon from '@fortawesome/react-fontawesome'; import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'; import './footer.css';"} +{"_id":"doc-en-freeCodeCamp-41bbc2a5875d9aadf8887d0673ca8823f05eb07defd4fd7e02aa3af92e232e5c","title":"","text":"return ( {children} ); };"} +{"_id":"doc-en-freeCodeCamp-979e72e00711bb553b47801316e71470759d0d0efddf728b0f990d9661572799","title":"","text":"import { userSelector, isSignedInSelector, openDonationModal, showDonationSelector, submitComplete, updateComplete, updateFailed"} +{"_id":"doc-en-freeCodeCamp-1fda2be46a14613aed971dd627197b0f351f67fab5c6e7926b0e16e1658c2492","title":"","text":"'project.backEnd': submitProject }; function shouldShowDonate(state) { return showDonationSelector(state) ? of(openDonationModal()) : empty(); } export default function completionEpic(action$, state$) { return action$.pipe( ofType(types.submitChallenge), switchMap(({ type }) => { const state = state$.value; const meta = challengeMetaSelector(state); const { isDonating } = userSelector(state); const { nextChallengePath, introPath, challengeType } = meta; const showDonate = isDonating ? empty() : shouldShowDonate(state); const closeChallengeModal = of(closeModal('completion')); let submitter = () => of({ type: 'no-user-signed-in' }); if ("} +{"_id":"doc-en-freeCodeCamp-7c8b48809585cc2012a5996aa33cc94a2dd4b89c86df68b55127cceae4852cf8","title":"","text":"return submitter(type, state).pipe( tap(() => navigate(introPath ? introPath : nextChallengePath)), concat(closeChallengeModal), concat(showDonate), filter(Boolean) ); })"} +{"_id":"doc-en-freeCodeCamp-cec72107df961099ff0e2f927e2b22a85e8a0a5a6ebeee89f78ee32f137772a7","title":"","text":"import { isSignedInSelector, currentChallengeIdSelector, openDonationModal, showDonationSelector, updateComplete, updateFailed updateFailed, userSelector } from '../../../redux'; import { post } from '../../../utils/ajax';"} +{"_id":"doc-en-freeCodeCamp-dbc5ce5b834c3dda623814e8558440fef14209f689c4c7406ed4b02c30410a2c","title":"","text":"yield put(updateSuccessMessage(randomCompliment())); } function* showDonateModalSaga() { let { isDonating } = yield select(userSelector); let shouldShowDonate = yield select(showDonationSelector); if (!isDonating && shouldShowDonate) { yield put(openDonationModal()); } } export function createCurrentChallengeSaga(types) { return [ takeEvery(types.challengeMounted, currentChallengeSaga), takeEvery(types.challengeMounted, updateSuccessMessageSaga) takeEvery(types.challengeMounted, updateSuccessMessageSaga), takeEvery(types.challengeMounted, showDonateModalSaga) ]; }"} +{"_id":"doc-en-freeCodeCamp-4e79abe9d59ff6020ccaee21c8fcc818ba6d0a2b65b2e611b1fcd94a52611368","title":"","text":"Вы можете внести свой вклад в интересующую вас область: 1. [Внести вклад в этот открытый репозиторий.](#contribute-to-this-open-source-codebase) 1. [Внести вклад в этот открытый репозиторий.](#внести-свой-вклад-в-этот-open-source-проект) Помогите нам в создании или редактировании [обучающих статей](https://www.freecodecamp.org/guide), [задач по программированию](https://www.freecodecamp.org/learn) или исправлении ошибок н�� нашей обучающей платформе."} +{"_id":"doc-en-freeCodeCamp-aaf4133637c17315fe08dd07512c9f5c6a91590c079100baa1169febed5f5f1c","title":"","text":"Вы можете помочь нам: - [📝 В исследовании, написании и обновлении статей нашего руководства.](#research-write-and-update-our-guide-articles) - [📝 В исследовании, написании и обновлении статей нашего руководства.](#изучение-написание-и-обновление-статей-нашего-руководства) - [💻 В создании, обновлении и исправлении ошибок в наших задачах по программированию.](#create-update-and-fix-bugs-in-our-curriculum-challenges) - [💻 В создании, обновлении и исправлении ошибок в наших задачах по программированию.](#создание-обновление-и-исправление-ошибок-в-наших-задачах-на-кодирование) - [🌐 В переводе обучающих статей и задач по программированию.](#translate-guide-articles-and-curriculum-challenges) - [🌐 В переводе обучающих статей и задач по программированию.](#перевод-статей-руководства-и-задач-на-кодирование) - [🛠 В исправлении ошибок на обучающей платформе freeCodeCamp.org](#help-us-fix-bugs-in-freecodecamporgs-learning-platform) - [🛠 В исправлении ошибок на обучающей платформе freeCodeCamp.org](#помогите-нам-исправить-ошибки-в-обучающей-платформе-freecodecamporg) ### Изучение, написание и обновление статей нашего руководства"} +{"_id":"doc-en-freeCodeCamp-b2b844d8cff31a0b068d129dad74631ecc883e11f22818fcd946ab3754ce25c9","title":"","text":"Puedes optar por contribuir a cualquier área de tu interés: 1. [Contribuir a esta base de código fuente abierto.](#contribute-to-this-open-source-codebase) 1. [Contribuir a esta base de código fuente abierto.](#contribuye-a-esta-base-de-código-abierto) Ayúdanos a crear o editar [artículos de guía](https://www.freecodecamp.org/guide), [desafíos de codificación](https://www.freecodecamp.org/learn) o a corregir errores en la plataforma de aprendizaje."} +{"_id":"doc-en-freeCodeCamp-8abcb80121cc7764a738948f99cf3e3606ab93c47a2940fc70e7e3bca9fd4779","title":"","text":"Puedes ayudarnos a: - [📝 Investigar, escribir y actualizar nuestras guías.](#investiga-escribe-y-actualiza-nuestros-artículos-de-guía) - [📝 Investigar, escribir y actualizar nuestras guías.](#investiga-escribe-y-actualiza-nuestras-guías) - [💻 Crear, actualizar y corregir errores en nuestros desafíos de código.](#crear-actualizar-y-corregir-errores-en-nuestros-desafíos-de-codificación) - [🌐 Traducir artículos de guía y desafíos de código.](#traducir-artículos-de-guía-y-desafíos-de-codificación) - [🛠 Corregir errores en la plataforma de aprendizaje de freeCodeCamp.org.](#ayúdenos-a-corregir-errores-en-la-plataforma-de-aprendizaje-de-freeCodeCamp.org) - [🛠 Corregir errores en la plataforma de aprendizaje de freeCodeCamp.org.](#investiga-escribe-y-actualiza-nuestras-guías) ### Investiga, escribe y actualiza nuestras guías"} +{"_id":"doc-en-freeCodeCamp-bd27195fcf7e509cd0d145e8119d143342a4403337df9c6b0982e7015c6a648b","title":"","text":"3. 帮助我们为[YouTube频道视频](https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ/videos)添加字幕。 ##贡献予开源代码库 ## 贡献予开源代码库 我们有数以千计的[编码挑战](https://learn.freecodecamp.org)和[指南文章](https://guide.freecodecamp.org)集中在这个庞大的开源代码库中。"} +{"_id":"doc-en-freeCodeCamp-68b00b5056c1847499679ad3b42e285856bb468387913572bf59d88fcc71ec34","title":"","text":"- [📝 研究,编写和更新我们的指南文章](#研究编写和更新我们的指南文章) - [💻 创建,更新编码挑战和修复其中的错误](创建更新编码挑战和修复其中的错误) - [💻 创建,更新编码挑战和修复其中的错误](#创建更新编码挑战和修复其中的错误) - [🌐 翻译指南文章和编码挑战](#翻译指南文章和编码挑战) - [🛠 帮助我们修复freeCodeCamp.org学习平台中的错误](#帮助我们修复freeCodeCamp.org学习平台中的错误) - [🛠 帮助我们修复freeCodeCamp.org学习平台中的错误](#帮助我们修复freecodecamporg学习平台中的错误) ### 研究,编写和更新我们的指南文章"} +{"_id":"doc-en-freeCodeCamp-12d59dba384a40095072ec88cd02d5a0f3360a02454903b0fb61ffc9a9723d4a","title":"","text":"1. [Contribua para essa base de códigos abertos.](#contribua-para-essa-base-de-códigos-abertos) Nos ajude criando e editando [Artigos de guias](https://www.freecodecamp.org/guide), [desafios de código](https://www.freecodecamp.org/learn) e corrigindo bugs na plataforma de aprendizado. Nos ajude criando e editando [Artigos de guias](https://guide.freecodecamp.org), [desafios de código](https://www.freecodecamp.org/learn) e corrigindo bugs na plataforma de aprendizado. 2. Ajude campistas em nosso [fórum público](https://www.freecodecamp.org/forum/)."} +{"_id":"doc-en-freeCodeCamp-58a0516da450bef8daef106ed088249da5dd26b517bedb3998a7e44eeea45d9a","title":"","text":"id: 5a94fe8569fb03452672e464 title: Create Grids within Grids challengeType: 0 videoUrl: 'https://scrimba.com/p/pByETK/c6N78Ap' forumTopicId: 301128 ---"} +{"_id":"doc-en-freeCodeCamp-49910db5ffadb3b91cfd1637be23b275a274f2cf35e5ab3f4d56f52ba6252ea6","title":"","text":"align-items: center; max-width: 960px; margin: 0 auto; padding: 0 15px; }"} +{"_id":"doc-en-freeCodeCamp-315c227c106a0a502300c2603ff2100ed50957c99ba7c7f3a65904140ca89b72","title":"","text":"padding: 0; margin: 0; border: none; background-color: white; } .enable-iframe {"} +{"_id":"doc-en-freeCodeCamp-28596e91222fad78366cbeedb8a883ce4d6ff259e6562149e6f7a8392aced2a1","title":"","text":"} from 'lodash'; import { compileHeadTail, setExt, transformContents } from '../utils/polyvinyl'; import { nightThemeStyle } from './displayStyle.js'; const htmlCatch = 'nn'; const jsCatch = 'n;/*fcc*/n';"} +{"_id":"doc-en-freeCodeCamp-3abb7b043ccbda9530c7ddaeb7c9f9280eee0a38f6e5c818455c95dd40cd1f54","title":"","text":"[stubTrue, identity] ]); export function concatHtml({ required = [], template, files = [], theme = 'night' } = {}) { theme = theme === '' ? 'night' : theme; export function concatHtml({ required = [], template, files = [] } = {}) { const createBody = template ? _template(template) : defaultTemplate; const displayTheme = theme === 'night' ? nightThemeStyle : ` `; const head = required .map(({ link, src }) => { if (link && src) {"} +{"_id":"doc-en-freeCodeCamp-ba24aebd423ce9687d72c945e81b257cc9e4dc7aa9ed6ce1c361d7145f6eeb85","title":"","text":"} return ''; }) .reduce((head, element) => head.concat(element), displayTheme); .reduce((head, element) => head.concat(element)); const source = files.reduce( (source, file) => source.concat(file.contents, htmlCatch),"} +{"_id":"doc-en-freeCodeCamp-7c5a09a75181c7e8dd97b6d1e70dfd0d190d36ca28c7716b840a16189ce02dbd","title":"","text":" export const nightThemeStyle = ` `; "} +{"_id":"doc-en-freeCodeCamp-1b23c12b7149f68541048a0d82b9d38f6e6f4cddcae8cd3bd64ba8082b4e93e2","title":"","text":"import { createExecuteChallengeSaga } from './execute-challenge-saga'; import { createCurrentChallengeSaga } from './current-challenge-saga'; import { challengeTypes } from '../../../../utils/challengeTypes'; import { userSelector } from '../../../redux'; export const ns = 'challenge'; export const backendNS = 'backendChallenge';"} +{"_id":"doc-en-freeCodeCamp-04c240b9afba40f7033c9dcc432a1690895c32a5bf2468cf0046fb719ec5d0ce","title":"","text":"state[ns].projectFormValues || {}; export const challengeDataSelector = state => { const { theme } = userSelector(state); const { challengeType } = challengeMetaSelector(state); let challengeData = { challengeType }; if ("} +{"_id":"doc-en-freeCodeCamp-74eee25e108173bb75e88790317ac0502b6ba88daa71f00b1744172c94fcebca","title":"","text":"template }; } challengeData.theme = theme; return challengeData; };"} +{"_id":"doc-en-freeCodeCamp-cf81084053f70aa409efca5b5fae125edbe7a3926613ed950e9fdfe0a81ae0de","title":"","text":"runTestInTestFrame(document, testString, testTimeout); } export function buildDOMChallenge({ files, required = [], template = '', theme = `` }) { export function buildDOMChallenge({ files, required = [], template = '' }) { const finalRequires = [...globalRequires, ...required, ...frameRunner]; const loadEnzyme = Object.keys(files).some(key => files[key].ext === 'jsx'); const toHtml = [jsToHtml, cssToHtml];"} +{"_id":"doc-en-freeCodeCamp-65ec91f62e7310d3b83225065fe14adec18279b15ee2b9b658438a4b7a49b35a","title":"","text":".then(checkFilesErrors) .then(files => ({ challengeType: challengeTypes.html, build: concatHtml({ required: finalRequires, template, files, theme }), build: concatHtml({ required: finalRequires, template, files }), sources: buildSourceMap(files), loadEnzyme }));"} +{"_id":"doc-en-freeCodeCamp-a73a1e9b2818fefd9ee1a3b11edc04659895bb4f84cf26306503358ecbf69f16","title":"","text":"} .certification-namespace.certificate-wrapper { top: calc(100vh / 20); position: relative; font-family: 'Sax Mono', monospace; }"} +{"_id":"doc-en-freeCodeCamp-655272e91bce27232ef4c63d40423ce8594adfea20508a2e461ccf84d9374d39","title":"","text":"FormGroup, ControlLabel, Button, Col Col, Row } from '@freecodecamp/react-bootstrap'; import Helmet from 'react-helmet';"} +{"_id":"doc-en-freeCodeCamp-bef71c2ab1225f6732c3dbcb86d5e8d89dbae17488ae3bdcd7e7db5a4aaca77b","title":"","text":"} const { textarea } = this.state; const placeholderText = `Please provide as much detail as possible about the account or behavior you are reporting.`; return ( Report a users profile | freeCodeCamp.org

Do you want to report {username} 's profile for abuse?

We will notify the community moderators' team, and a send copy of this report to your email:{' '} {email}. this report to your email: {email}

We may get back to you for more information, if required.

Additional Information What would you like to report? placeholder='' placeholder={placeholderText} value={textarea} />
); }"} +{"_id":"doc-en-freeCodeCamp-0df06ecd356f761024e8a2263f6865fa5e6359968ce44198c7095f31d93959da","title":"","text":" require('dotenv').config(); const env = require('../config/env'); const { createFilePath } = require('gatsby-source-filesystem');"} +{"_id":"doc-en-freeCodeCamp-1ea56a9fb4e831fd1fa52fc7595d5e8d7a6d4a2f64bf0738b32b8c89924878d0","title":"","text":"} }; exports.createPages = function createPages({ graphql, actions }) { exports.createPages = function createPages({ graphql, actions, reporter }) { if (!env.algoliaAPIKey || !env.algoliaAppId) { if (process.env.FREECODECAMP_NODE_ENV === 'production') { throw new Error( 'Algolia App id and API key are required to start the client!' ); } else { reporter.info( 'Algolia keys missing or invalid. Required for search to yield results.' ); } } const { createPage } = actions; return new Promise((resolve, reject) => {"} +{"_id":"doc-en-freeCodeCamp-5385a4cf50009d67cc7ebe4fb9a32a634a980bad4072d081f79d8192a9eb6af0","title":"","text":"const DEBOUNCE_TIME = 100; const searchClient = algoliasearch(algoliaAppId, algoliaAPIKey); // If a key is missing, searches will fail, but the client will still render. const searchClient = algoliaAppId && algoliaAPIKey ? algoliasearch(algoliaAppId, algoliaAPIKey) : {}; const propTypes = { children: PropTypes.any,"} +{"_id":"doc-en-freeCodeCamp-8e3cad7c916cc8a5feb2994f6a35c013aa7a6c9b13a7cb860dd6ec126ad8b00f","title":"","text":"module.exports = Object.assign(locations, { locale, stripePublicKey, algoliaAppId, algoliaAPIKey algoliaAppId: !algoliaAppId || algoliaAppId === 'Algolia app id from dashboard' ? null : algoliaAppId, algoliaAPIKey: !algoliaAPIKey || algoliaAPIKey === 'Algolia api key from dashboard' ? null : algoliaAPIKey });"} +{"_id":"doc-en-freeCodeCamp-65a5e8c8273ce3def9c99c8d98308b51b2ea66f8a05f4b5a957ab573fab165b8","title":"","text":"ROLLBAR_CLIENT_ID='post_client_id from rollbar dashboard' ALGOLIA_ADMIN_KEY=123abc ALGOLIA_APP_ID=ACDEFG ALGOLIA_API_KEY=123abc ALGOLIA_APP_ID='Algolia app id from dashboard' ALGOLIA_API_KEY='Algolia api key from dashboard' AUTH0_CLIENT_ID=stuff AUTH0_CLIENT_SECRET=stuff"} +{"_id":"doc-en-freeCodeCamp-068ef6036b4a5ca5758546e51f00d0d0714d3a06871404f050946bccbf398e98","title":"","text":"h3 { font-size: 1rem; } .btn-cta { font-size: 1.2rem; } } .text-center {"} +{"_id":"doc-en-freeCodeCamp-20d878d6d74979d2dec56814132b5824e94a1df989309708fbc24ad63d8c2f0f","title":"","text":"## Description
We can access the data inside arrays using indexes. Array indexes are written in the same bracket notation that strings use, except that instead of specifying a character, they are specifying an entry in the array. Like strings, arrays use zero-based indexing, so the first element in an array is element 0. Array indexes are written in the same bracket notation that strings use, except that instead of specifying a character, they are specifying an entry in the array. Like strings, arrays use zero-based indexing, so the first element in an array has an index of 0.
Example"} +{"_id":"doc-en-freeCodeCamp-e469ea1645157a499d2429300e9eb8e0f28602d94cf9ccf87e3448ebcdcda549","title":"","text":"```js let testStr = \"Pumpkin\"; let testRegex = /P(engu|umpk)in/g; let testRegex = /P(engu|umpk)in/; testRegex.test(testStr); // Returns true ```"} +{"_id":"doc-en-freeCodeCamp-2bcc0b6a5f05c03b20e6a1239c0f8a985d10af9cac6e1c5e4cac70e80ac64c3e","title":"","text":"```yml tests: - text: Your regex myRegex should return true for the string Franklin D. Roosevelt testString: assert(myRegex.test('Franklin D. Roosevelt')); testString: myRegex.lastIndex = 0; assert(myRegex.test('Franklin D. Roosevelt')); - text: Your regex myRegex should return true for the string Eleanor Roosevelt testString: assert(myRegex.test('Eleanor Roosevelt')); testString: myRegex.lastIndex = 0; assert(myRegex.test('Eleanor Roosevelt')); - text: Your regex myRegex should return false for the string Franklin Rosevelt testString: assert(!myRegex.test('Franklin Rosevelt')); testString: myRegex.lastIndex = 0; assert(!myRegex.test('Franklin Rosevelt')); - text: You should use .test() to test the regex. testString: assert(code.match(/myRegex.test(s*myStrings*)/)); - text: Your result should return true."} +{"_id":"doc-en-freeCodeCamp-7c37a7bca5c8699fb091a87ee7fee997378f119723c7d9c1f51d8a6b71983e81","title":"","text":" {!closeLabel && ( Nicely done. You just completed {blockNameify(block)}. Nicely done. You just completed {blockNameify(block)}. {donationText} )}"} +{"_id":"doc-en-freeCodeCamp-ce8e0be832282671fff4e581a4e63ec05a6a27c6a4b27ed813cbb6ec9d27beb5","title":"","text":"--- ## Introduction to the Managing Packages with npm Challenges The Node Package Manager (npm) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.

When starting a new project, npm generates a package.json file. This file lists the package dependencies for your project. Since npm packages are regularly updated, the package.json file allows you to set specific version numbers for each dependency. This ensures that updates to a package don't break your project.

npm saves packages in a folder named node_modules. These packages can be installed in two ways:

  1. globally in a root node_modules folder, accessible by all projects.
  2. locally within a project's own node_modules folder, accessible only to that project.

Most developers prefer to install packages local to each project to create a separation between the dependencies of different projects. Working on these challenges will involve you writing your code on Glitch on our starter project. After completing each challenge you can copy your public Glitch url (to the homepage of your app) into the challenge screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.
Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!
The Node Package Manager (npm) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.

When starting a new project, npm generates a package.json file. This file lists the package dependencies for your project. Since npm packages are regularly updated, the package.json file allows you to set specific version numbers for each dependency. This ensures that updates to a package don't break your project. npm saves packages in a folder named node_modules. These packages can be installed in two ways: 1. globally in a root node_modules folder, accessible by all projects. 2. locally within a project's own node_modules folder, accessible only to that project. Most developers prefer to install packages local to each project to create a separation between the dependencies of different projects. Working on these challenges will involve you writing your code on Glitch on our starter project. After completing each challenge you can copy your public Glitch url (to the homepage of your app) into the challenge screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing. Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!
"} +{"_id":"doc-en-freeCodeCamp-3f5ac6760d720dd13c7fc2e80000c1f925e72415df39297c7029f69765ba53f4","title":"","text":"tests: - text: The AppWrapper should render to the page. testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find('AppWrapper').length === 1; })()); - text: The Presentational component should render an h2, input, button, and ul elements. - text: The Presentational component should render to page. testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find('Presentational').length === 1; })()); - text: The Presentational component should render an h2, input, button, and ul elements. testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find('Presentational'); return ( PresentationalComponent.find('div').length === 1 && PresentationalComponent.find('h2').length === 1 && PresentationalComponent.find('button').length === 1 && PresentationalComponent.find('ul').length === 1 ); })());"} +{"_id":"doc-en-freeCodeCamp-d62ff44c8bedcf9b9158658b57e6a8819f3f274b2389529e9a61da3b860f62e3","title":"","text":"Usernames are used everywhere on the internet. They are what give users a unique identity on their favorite sites. You need to check all the usernames in a database. Here are some simple rules that users have to follow when creating their username. 1) Usernames can only use alpha-numeric characters. 2) The only numbers in the username have to be at the end. There can be zero or more of them at the end. 2) The only numbers in the username have to be at the end. There can be zero or more of them at the end. Username cannot start with the number. 3) Username letters can be lowercase and uppercase. 4) Usernames have to be at least two characters long. A two-character username can only use alphabet letters as characters.
"} +{"_id":"doc-en-freeCodeCamp-8fce7b7bc4cad4567651625a3bcfeeaf27a40768b95a548e489e051c9a8c57ec","title":"","text":"script.innerHTML = tryTransform(babelTransformCode(babelOptionsJS))( script.innerHTML ); console.log('transformed:', script.innerHTML); }); }"} +{"_id":"doc-en-freeCodeCamp-ef21dffecca73c3a46992abb943b5343a3409d2a4f2370e7b1d3797f1ea2ca1d","title":"","text":"{subscriptionPayment ? ( Confirm your donation of ${donationAmount / 100} / year with PayPal: Confirm your donation of ${donationAmount / 100} /{' '} {donationDuration} with PayPal: "} +{"_id":"doc-en-freeCodeCamp-809e96adb74b441195836bce1f6fef081b3944236ad0c436acf2feed46650156","title":"","text":"```yml tests: - text: The function countOnline should use a `for in` statement to iterate through the object keys of the object passed to it. testString: assert(code.match(/fors*(s*(var|let)s+[a-zA-Z_$]w*s+ins+[a-zA-Z_$]w*s*)s*{/)); testString: assert(code.match(/fors*(s*(var|let|const)s+[a-zA-Z_$]w*s+ins+[a-zA-Z_$]w*s*)s*{/)); - text: 'The function countOnline should return 1 when the object { Alan: { online: false }, Jeff: { online: true }, Sarah: { online: false } } is passed to it' testString: assert(countOnline(usersObj1) === 1); - text: 'The function countOnline should return 2 when the object { Alan: { online: true }, Jeff: { online: false }, Sarah: { online: true } } is passed to it'"} +{"_id":"doc-en-freeCodeCamp-71862f7a92fb0a51ce34eb1f4219bd1a48196ea510a405e4daaba2f4bf572730","title":"","text":"- text: Your code should set the font-size property for the h5 tag to 21 pixels. testString: assert($('h5').css('font-size') == '21px'); - text: Your code should set the font-size property for the h6 tag to 14 pixels. testString: assert($('h6').css('font-size') == '14px'); testString: const regex = /h6s*{s*font-sizes*:s*14pxs*(;s*}|})/i; assert.strictEqual(true, regex.test(code)); ```"} +{"_id":"doc-en-freeCodeCamp-358cda82dcd0ab9e2a3d8c946997049acb850f269fef79a09c827c3b0696193e","title":"","text":" + 'Since 2015, 40,000 graduates have gotten jobs at tech ' + 'companies including Google, Apple, Amazon, and Microsoft.' name='twitter:description' />"} +{"_id":"doc-en-freeCodeCamp-8de7e290534cacc158b9731300bc9c8893e3eb3991c3e1cdcbc07716d28b6a28","title":"","text":" No newline at end of file "} +{"_id":"doc-en-freeCodeCamp-6880df6836e82bd5bb4197832b4a03db21d73aba397b05759da1629509fbef80","title":"","text":"return res.redirect('/forgot'); } res.render('account/reset', { title: 'Password Reset' title: 'Password Reset', token: req.params.token }); }); };"} +{"_id":"doc-en-freeCodeCamp-c36c9b2afefccfe255d3521d81c1e4165897857349f5ca9e46e20ddf06e7854b","title":"","text":"from: 'Team@freecodecamp.com', subject: 'Reset your Free Code Camp password', text: [ 'You are receiving this email because you (or someone else)', 'You are receiving this email because you (or someone else)n', 'requested we reset your Free Code Camp account's password.nn', 'Please click on the following link, or paste this into your', 'Please click on the following link, or paste this into yourn', 'browser to complete the process:nn', 'http://', req.headers.host, '/reset/', token, 'nn', 'If you did not request this, please ignore this email and', 'If you did not request this, please ignore this email andn', 'your password will remain unchanged.n' ].join(' ') ].join('') }; transporter.sendMail(mailOptions, function(err) { if (err) { return done(err); }"} +{"_id":"doc-en-freeCodeCamp-d42c01fa2575872f12175a335b4c215564ed5810d7eb05271b34c3f129f09af8","title":"","text":"extends ../layout block content .col-sm-8.col-sm-offset-2 form(method='POST') legend Reset Password .col-sm-8.col-sm-offset-2.jumbotron form(action='/reset/#{token}', method='POST') h1 Reset Password input(type='hidden', name='_csrf', value=_csrf) .form-group label(for='password') New Password"} +{"_id":"doc-en-freeCodeCamp-65662a717143cb63bb9bcb7a4adbb0f4cdefdaeaccb18a0af8d6ec6428b54862","title":"","text":"```yml question: text: 'What type of HTTP is request is usually used to access a website?' text: 'What type of HTTP request is usually used to access a website?' answers: - 'POST' - 'GET'"} +{"_id":"doc-en-freeCodeCamp-792840a6bed6d4b86e007498f6b5c07bf770c38380470f2793cd48d58200b28b","title":"","text":"## Description
You are given two arrays and an index. Use the array methods slice and splice to copy each element of the first array into the second array, in order. Copy each element of the first array into the second array, in order. Begin inserting elements at index n of the second array. Return the resulting array. The input arrays should remain the same after the function runs.
"} +{"_id":"doc-en-freeCodeCamp-fc6382819a7102b3e6653496257d2881d4220890e17d474ab1572f685d2d080e","title":"","text":"```yml tests: - text: The globalTitle variable should not change. testString: assert(globalTitle === \"Winter Is Coming\"); - text: Your code should not use the replace method for this challenge. testString: assert(!code.match(/.?[sS]*?replace/g)); - text: urlSlug(\"Winter Is Coming\") should return \"winter-is-coming\"."} +{"_id":"doc-en-freeCodeCamp-d1ea7dc7841258fa3f60384d32d3938f07ae671c3f05da7df81fad6e26e57ba9","title":"","text":"
```js // The global variable var globalTitle = \"Winter Is Coming\"; // Only change code below this line function urlSlug(title) {"} +{"_id":"doc-en-freeCodeCamp-629c11f43d9f842a36a83b66653f0eb3af7f65afb140cbed1a0d533ab2c65fac","title":"","text":"
```js // The global variable var globalTitle = \"Winter Is Coming\"; // Only change code below this line function urlSlug(title) { return title.trim().split(/s+/).join(\"-\").toLowerCase();"} +{"_id":"doc-en-freeCodeCamp-6cb490d277e4e8818213e493408dd74fd2cbb6f92efa9e06e34f65bf2e5e316b","title":"","text":"return (
# --instructions--"} +{"_id":"doc-en-freeCodeCamp-16823b863b047dc383ce82fb6c26b987e2db973ee3366d1fbc717f003f95e85d","title":"","text":"# --description-- Continuing with the date theme, HTML5 also introduced the `time` element along with a `datetime` attribute to standardize times. The `datetime` attribute is an inline element that can wrap a date or time on a page. A `datetime` attribute holds a valid format of that date. This is the value accessed by assistive devices. It helps avoid confusion by stating a standardized version of a time, even if it's informally or colloquially written in the text. Continuing with the date theme, HTML5 also introduced the `time` element along with a `datetime` attribute to standardize times. The `time` element is an inline element that can wrap a date or time on a page. A `datetime` attribute holds a valid format of that date. This is the value accessed by assistive devices. It helps avoid confusion by stating a standardized version of a time, even if it's informally or colloquially written in the text. Here's an example:"} +{"_id":"doc-en-freeCodeCamp-d9467be7ba8caf84c43c29430b27713e3af0c63c7d3c60a682a89c3773e96510","title":"","text":"} api.get('/signout', (req, res) => { const { origin } = getRedirectParams(req); const { origin, returnTo } = getRedirectParams(req); req.logout(); req.session.destroy(err => { if (err) {"} +{"_id":"doc-en-freeCodeCamp-9aeed79e335c8e5688c33a38acfad0dc56d88e561f3403f7543739c562f81fa3","title":"","text":"}); } removeCookies(req, res); res.redirect(origin); res.redirect(returnTo); }); });"} +{"_id":"doc-en-freeCodeCamp-5a3ac059805b0583e0ed5fe197ed7cad2f3a118c4c76015b58a148051e0b346f","title":"","text":"isRootPath } from './utils/redirection'; import { jwtSecret } from '../../../config/secrets'; import { availableLangs } from '../../../config/i18n/all-langs'; const passportOptions = { emailOptional: true,"} +{"_id":"doc-en-freeCodeCamp-f57a336205a8c09dee4d7cf5214c265276699f1a3bec17963083c35582e601c6","title":"","text":"export const devLoginRedirect = () => { return (req, res) => { // this mirrors the production approach, but without any validation // this mirrors the production approach, but only validates the prefix let { returnTo, origin, pathPrefix } = getRedirectParams( req, params => params ({ returnTo, origin, pathPrefix }) => { pathPrefix = availableLangs.client.includes(pathPrefix) ? pathPrefix : ''; return { returnTo, origin, pathPrefix }; } ); returnTo += isRootPath(getRedirectBase(origin, pathPrefix), returnTo) ? 'learn' ? '/learn' : ''; return res.redirect(returnTo); };"} +{"_id":"doc-en-freeCodeCamp-2b92d1be6cb557a188380c1a18e20240f628c7bccaf14bd017bd3b2b565ebba3","title":"","text":"const origin = returnUrl.origin; // if this is not one of the client languages, validation will convert // this to '' before it is used. const pathPrefix = returnUrl.pathname.split('/')[0]; const pathPrefix = returnUrl.pathname.split('/')[1]; return _normalizeParams({ returnTo: returnUrl.href, origin, pathPrefix }); }"} +{"_id":"doc-en-freeCodeCamp-2a92606b37d3b0ace2be7f5535be215fddcbb3fa55a407215eab20b3b9fcd46a","title":"","text":"stroke: var(--color-quaternary); } .map-title svg:first-child { transform: rotate(90deg); } .open > .map-title svg:first-child { transform: rotate(-90deg); transform: rotate(90deg); } .map-challenges-ul {"} +{"_id":"doc-en-freeCodeCamp-f961ab08a3e8ef02e32a281216efc03977b01cea175a1e02c09aab9ce83b3263","title":"","text":"A game is played with three piles of stones and two players. On each player's turn, the player removes one or more stones from the piles. However, if the player takes stones from more than one pile, the same number of stunes must be removed from each of the selected piles. On each player's turn, the player removes one or more stones from the piles. However, if the player takes stones from more than one pile, the same number of stones must be removed from each of the selected piles. In other words, the player chooses some $N > 0$ and removes:"} +{"_id":"doc-en-freeCodeCamp-74c10c4bf7df147efd82f8d3205ad3743a0c4b6055a69deaf50dbb57feac1271","title":"","text":"Text is often a large part of web content. CSS has several options for how to align it with the `text-align` property. `text-align: justify;` causes all lines of text except the last line to meet the left and right edges of the line box. `text-align: justify;` spaces the text so that each line has equal width. `text-align: center;` centers the text"} +{"_id":"doc-en-freeCodeCamp-27d009cf5adbf2c020f72176fb372fdfeb0422193cfd4682dadedcfddbdaaf5e","title":"","text":"# --description-- One of the most popular shapes in the world is the heart shape, and in this challenge you'll create one using pure CSS. But first, you need to understand the `::before` and `::after` pseudo-elements. These pseudo-elements are used to add something before or after a selected element. In the following example, a `::before` pseudo-element is used to add a rectangle to an element with the class `heart`: One of the most popular shapes in the world is the heart shape, and in this challenge you'll create one using pure CSS. But first, you need to understand the `::before` and `::after` pseudo-elements. ::before creates a pseudo-element that is the first child of the selected element; ::after creates a pseudo-element that is the last child of the selected element. In the following example, a `::before` pseudo-element is used to add a rectangle to an element with the class `heart`: ```css .heart::before {"} +{"_id":"doc-en-freeCodeCamp-07da9d5f826aed1185f4c2910ef5cb3540faecc14b41638e80797345ac140e5d","title":"","text":"The `fieldset` element is used to group related inputs and labels together in a web form. `fieldset` elements are block-level elements, meaning that they appear on a new line. Nest the `Indoor` and `Outdoor` radio buttons within a `fieldset` element, and don't forget to indent the buttons. Nest the `Indoor` and `Outdoor` radio buttons within a `fieldset` element, and don't forget to indent the radio buttons. # --hints--"} +{"_id":"doc-en-freeCodeCamp-4529edaa08f2a05c0016ba3218a6d8bd6b833c431ab68e356de8f1f2174b34f1","title":"","text":"show={solutionOpen} > {`${username}'s Solution to ${ idToNameMap.get(id)?.challengeTitle ?? '' }`}"} +{"_id":"doc-en-freeCodeCamp-41822624089ad8b392929bbbc5733d2d09b34a21065de6c07c2f601bfb170843","title":"","text":"id: 'execute-challenge', label: 'Run tests', /* eslint-disable no-bitwise */ keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter], keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, monaco.KeyMod.WinCtrl | monaco.KeyCode.Enter ], run: () => { if (props.usesMultifileEditor && !isFinalProject(props.challengeType)) { if (challengeIsComplete()) {"} +{"_id":"doc-en-freeCodeCamp-44b695b89c3a3937e6d2a311626c48aaacfb1a55faf3a1df87b82b61baaf296b","title":"","text":"editor.addAction({ id: 'save-editor-content', label: 'Save editor content', keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S], keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_S ], run: props.challengeType === challengeTypes.multifileCertProject && props.isSignedIn"} +{"_id":"doc-en-freeCodeCamp-1e348c242b09d78b776fbbcab8bfa79dd5a7ce6c0df51ff3c3c32951c69b19b5","title":"","text":"editor.addAction({ id: 'toggle-accessibility', label: 'Toggle Accessibility Mode', keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E], keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E, monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_E ], run: () => { const currentAccessibility = storedAccessibilityMode();"} +{"_id":"doc-en-freeCodeCamp-5eb592840208617fbf59e3bf5fa815d1d30f3a7d92aebd72b0d62b61e75eae44","title":"","text":"You should add the first `input` after the `label` text `Enter Your First Name:`, and include a space after the colon. ```js assert.equal(document.querySelectorAll('label')?.[0]?.innerHTML, 'Enter Your First Name: '); assert.equal(document.querySelectorAll('label')?.[0]?.innerHTML.trim(), 'Enter Your First Name: '); ``` You should add the second `input` after the `label` text `Enter Your Last Name:`, and include a space after the colon. ```js assert.equal(document.querySelectorAll('label')?.[1]?.innerHTML, 'Enter Your Last Name: '); assert.equal(document.querySelectorAll('label')?.[1]?.innerHTML.trim(), 'Enter Your Last Name: '); ``` You should add the third `input` after the `label` text `Enter Your Email:`, and include a space after the colon. ```js assert.equal(document.querySelectorAll('label')?.[2]?.innerHTML, 'Enter Your Email: '); assert.equal(document.querySelectorAll('label')?.[2]?.innerHTML.trim(), 'Enter Your Email: '); ``` You should add the fourth `input` after the `label` text `Create a New Password:`, and include a space after the colon. ```js assert.equal(document.querySelectorAll('label')?.[3]?.innerHTML, 'Create a New Password: '); assert.equal(document.querySelectorAll('label')?.[3]?.innerHTML.trim(), 'Create a New Password: '); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-d87778250fa30802ed60d517efdd4ec1659e91b5bf087e9b7686e0fbc62156b1","title":"","text":"# --description-- Cramer's rule is a formula for solving a system of linear equations by using the determinants of matrixes formed from subsets of the coefficients and right hand side values. Cramer's rule is a formula for solving a system of linear equations by using the determinants of matrices formed from subsets of the coefficients and right hand side values. The determinate of a matrix with 2 rows and two columns is given by: The determinant of a matrix with 2 rows and two columns is given by: $begin{aligned}|A|={begin{vmatrix}a&bc&dend{vmatrix}}=ad-bc.end{aligned}$"} +{"_id":"doc-en-freeCodeCamp-d4dd2b105a1236561967b7e7d862d76aec22580deaed3e88e5a997c8657580d8","title":"","text":"## --text-- Which activation function switches values between -1 and 1? Which activation function squishes values between -1 and 1? ## --answers--"} +{"_id":"doc-en-freeCodeCamp-fa4328007ff4cb54bd14e40ea3291db732a98586b0b1d64b1f2ff06d4fe039a9","title":"","text":"assert(document.querySelectorAll('.characters > div')?.length === 4); ``` Your two new `div` elemnts should have the `class` set to `blue`. Your two new `div` elements should have the `class` set to `blue`. ```js const divs = document.querySelectorAll('.characters > div');"} +{"_id":"doc-en-freeCodeCamp-412746fb2672fac53dd82e822a4131152e58b565d3e9ee5184b2b96ad8f891af","title":"","text":"assert(isValidSolution_(solve24(testCases_[1]))); ``` `solve24(\"6789\")` should return `(6*8)/(9-7)`. `(8*6)/(9-7)`, or a similar valid string `solve24(\"6789\")` should return `(6*8)/(9-7)`, `(8*6)/(9-7)`, or a similar valid string ```js assert(isValidSolution_(solve24(testCases_[2])));"} +{"_id":"doc-en-freeCodeCamp-5f3dda77156f9e5808a516cc22e10d729ff672ef9ec61ec5e5d8599724e72521","title":"","text":"assert($('p > a').length); ``` The link's href value should be `https://freecatphotoapp.com`. You have either omitted the href value or have a typo. The link's `href` value should be `https://freecatphotoapp.com`. You have either omitted the `href` value or have a typo. ```js const nestedAnchor = $('p > a')[0];"} +{"_id":"doc-en-freeCodeCamp-751fa44e54ae3de09238e47febc4c605c1cc900be2522936ab27f4c569df62c4","title":"","text":"# --hints-- The endpoint `/json` should serve the json object `{\"message\": \"Hello json\"}` The endpoint `/json` should serve the JSON object `{\"message\": \"Hello json\"}` ```js (getUserInput) =>"} +{"_id":"doc-en-freeCodeCamp-a701eca9796923318ee9d513fbae526c9ad2543d9db80fb75e1f0ca0807444a1","title":"","text":"# --instructions-- Add version \"1.1.0\" of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. **Note:** `@freecodecamp/example` is a faux package used as a learning tool."} +{"_id":"doc-en-freeCodeCamp-4e083542efbc772f0c7aa550ccf02883e31df8d75e1718809d03bd0723b3541c","title":"","text":"When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field. The `package.json` file is the center of any Node.js project or npm package. It stores information about your project, similar to how the <head> section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; \"name\" and \"version\", but it’s good practice to provide additional information about your project that could be useful to future users or maintainers. The `package.json` file is the center of any Node.js project or npm package. It stores information about your project, similar to how the `head` section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information about your project that could be useful to future users or maintainers. If you look at the file tree of your project, you will find the package.json file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project."} +{"_id":"doc-en-freeCodeCamp-9cd9010a484fefd1e349d6f07bb5c367deb845f150c9b49a88d94ff4e3c5de15","title":"","text":"# --instructions-- Add your name as the `author` of the project in the package.json file. Add your name as the `author` of the project in the `package.json` file. **Note:** Remember that you’re writing JSON, so all field names must use double-quotes (\") and be separated with a comma (,). # --hints-- package.json should have a valid \"author\" key `package.json` should have a valid \"author\" key ```js (getUserInput) =>"} +{"_id":"doc-en-freeCodeCamp-5514e221ee48a3d221fae75d82fd1c72ad9109a47e1322283be5720244fefd9d","title":"","text":"Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. Your current version of `@freecodecamp/example` should be \"~1.2.13\" which allows npm to install to the latest 1.2.x version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any 1.x.x version. Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. ```json \"package\": \"^1.3.8\" ``` This would allow updates to any 1.x.x version of the package. This would allow updates to any `1.x.x` version of the package. # --instructions--"} +{"_id":"doc-en-freeCodeCamp-4cfed05b3fe6d211e879b43ce52a7fe05e660d759ec5036873a986538104652c","title":"","text":"In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any 1.3.x version. To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. ```json \"package\": \"~1.3.8\""} +{"_id":"doc-en-freeCodeCamp-1581878a553b2f1b04886edd07387a5856b7664da529c1398215dcaf73859a8c","title":"","text":"# --instructions-- In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (1.2.13). But now, you want to allow the latest 1.2.x version. In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release."} +{"_id":"doc-en-freeCodeCamp-d83a7ee5e1800d2bbc8b55b4c31356f7be253f6e08343a823f23aa867cd7316c","title":"","text":"Something does not look right. You added the correct `class` attribute value to the `p` element with `Donut` as its text, but you have not defined a selector for it. Since the `flavor` class selector already has the properties you want, just add the `dessert` class name to it. The CSS rule for the `flavor` class already sets the properties you want. Add the `dessert` class as an additional selector for this CSS rule. # --hints--"} +{"_id":"doc-en-freeCodeCamp-2f5b468ed07241648aedda2b26a96bf2ad574a0d7d6609aa69d5c1a9ae0801e5","title":"","text":"} const Spacer = ({ size, children }: SpacerProps): JSX.Element => (
{children}
);"} +{"_id":"doc-en-freeCodeCamp-0a690555f4574a9f26f49e467599491aa1dcf99310e2acc182b846eb1cb3daa2","title":"","text":"
style=\"padding: 15px 0px; height: 1px;\" style=\"padding: 15px 0px;\" />
style=\"padding: 15px 0px; height: 1px;\" style=\"padding: 15px 0px;\" />
style=\"padding: 15px 0px; height: 1px;\" style=\"padding: 15px 0px;\" />
style=\"padding: 15px 0px; height: 1px;\" style=\"padding: 15px 0px;\" />
"} +{"_id":"doc-en-freeCodeCamp-8c663fbc2424d49ffceda18cccda30999f75260b2a20d71eda722b46e182e100","title":"","text":"className=\"spacer\" style={ { \"height\": \"1px\", \"padding\": \"5px 0\", } }"} +{"_id":"doc-en-freeCodeCamp-fc2937b615feb9f987f664ab2b4c56d05a65fe972eff2b5071ad109a8c26fcef","title":"","text":"className=\"spacer\" style={ { \"height\": \"1px\", \"padding\": \"15px 0\", } }"} +{"_id":"doc-en-freeCodeCamp-7edd1f07966b263c560714052b6fe7c18452a4e8168b40cf75bd2b35b36db920","title":"","text":"# --instructions-- Write an `@each` directive that goes through a list: `blue, black, red` and assigns each variable to a `.color-bg` class, where the `color` part changes for each item. Each class should set the `background-color` the respective color. Write an `@each` directive that goes through a list: `blue, black, red` and assigns each variable to a `.color-bg` class, where the `color` part changes for each item to the respective color. Each class should set the `background-color` to the respective color as well. # --hints--"} +{"_id":"doc-en-freeCodeCamp-36abba10278b243b1b2547363254dca4909d671cc2ecea88100150dfbc4a39c8","title":"","text":"> [!NOTE] > If you are using Apple Devices with M1 Chip to run the application locally, it is suggested to use Node v14.7 or above. You might run into issues with dependencies like Sharp otherwise. ## Working With Other Languages To see how the client renders in another language go to [testing the client app in a world language.](how-to-work-on-localized-client-webapp.md#Testing-the-Client-App-in-a-World-Language) ## Getting Help If you are stuck and need help, feel free to ask questions in the ['Contributors' category on our forum](https://forum.freecodecamp.org/c/contributors) or [the contributors chat room](https://discord.gg/PRyKn3Vbay)."} +{"_id":"doc-en-freeCodeCamp-af0d6ea54cb94d4ecc8434fb7665523fa9cfe941d55a9f799d10939ab1adb22b","title":"","text":"}; }; const actRE = new RegExp(/act(...) is not supported in production builds/); const updateProxyConsole = (proxyLogger?: ProxyLogger) => (frameContext: Context) => { // window does not exist if the preview is hidden, so we have to check."} +{"_id":"doc-en-freeCodeCamp-b1050aad78d24427340c96fb276a88172b636955fef2d43b649d8278d05ee5d1","title":"","text":"frameContext.window.console.error = function proxyWarn( ...args: string[] ) { proxyLogger(args.map((arg: string) => utilsFormat(arg)).join(' ')); if (args.every(arg => !actRE.test(arg))) { proxyLogger(args.map((arg: string) => utilsFormat(arg)).join(' ')); } return oldError(...(args as [])); }; }"} +{"_id":"doc-en-freeCodeCamp-da834ad70cfc53bb4e254577e6648efdf9e744b6aa47b888230900a18116c539","title":"","text":"# --description-- The child combinator selector `>` is used between selectors to target only elements that match the second selector and are a direct child of the first selector. This can be helpful when you have deeply nested elements and want to control the scope of your styling. Use the `>` selector to target the unordered list elements within the `nav` elements, and use _Flexbox_ to evenly space the children. # --hints--"} +{"_id":"doc-en-freeCodeCamp-3e2a74b1b251e30e48d299ff2d5ef274e5a7d77af04bd07b0498de7592228607","title":"","text":" [![Stories in Ready](https://badge.waffle.io/FreeCodeCamp/freecodecamp.png?label=ready&title=Ready)](https://waffle.io/FreeCodeCamp/freecodecamp) Free Code Camp!"} +{"_id":"doc-en-freeCodeCamp-e77a69cb08209892fd54e674a5f38cb11cff88b5fe09772d6ba42574be1ef983","title":"","text":" npx lint-staged NODE_OPTIONS=\"--max-old-space-size=7168\" npx lint-staged "} +{"_id":"doc-en-freeCodeCamp-0e7ad78ed4b6e996f519305c5379a4390494c4a78581f45e6dd6150d4cbbebfe","title":"","text":"\"knip\": \"npx -y knip@1 --include files\", \"knip:all\": \"npx -y knip@1\", \"prelint\": \"pnpm run -F=client predevelop\", \"lint\": \"npm-run-all create:shared -p lint:*\", \"lint\": \"NODE_OPTIONS=\"--max-old-space-size=7168\" npm-run-all create:shared -p lint:*\", \"lint:challenges\": \"cd ./curriculum && pnpm run lint\", \"lint:js\": \"eslint --cache --max-warnings 0 .\", \"lint:ts\": \"tsc && tsc -p shared && tsc -p api\","} +{"_id":"doc-en-freeCodeCamp-3fa2e9a51e76da9feadfee99af632b512e3b6760f08ec6b93b4933471b852bad","title":"","text":"# --description-- Add one final property to the object named `text`. Give this property the final `text.innerText` value from the `goTown` function. Add one final property to the object named `text`. Give this property the same string value as the one assigned to `text.innerText` in the `goTown` function. # --hints--"} +{"_id":"doc-en-freeCodeCamp-2802281ac7d8362f86cbd9bfa2160d359f9efa48d6598f2e01ea5952c5e1ea52","title":"","text":"Your `setAttribute` method should have ``song?.title ? `Play ${song.title}` : \"Play\"`` as the second argument. ```js assert.match(code, /playButton.setAttribute(s*('|\")aria-label1,s*song?.titles*?s*`Plays*${song.title}`s*:s*1Play1s*);?s*/) assert.match(code, /playButton.setAttribute(s*('|\")aria-label1,s*song?.titles*?s*`Plays*${song.title}`s*:s*('|\")Play2s*);?s*/) ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-63abc25764fe0dcc2e009d31681217dd27250faa6ca2457eca0013779b7584a3","title":"","text":"To run all Playwright tests, run the following command: ```bash cd e2e npx playwright test ```"} +{"_id":"doc-en-freeCodeCamp-cf1e1fd92d924ebe72e26b4cc96a17c8a1f32dca43f3532959ca732e097b8594","title":"","text":"# --description-- You need to determine whether the task being added already exists or not. If it doesn't exist, you will add it, and if it already exists, you will set it up for editing. You can use the `findIndex()` method to accomplish this. You will need to determine whether the task being added to the `taskData` array already exists or not. If the task does not exist, you will add it to the array. If it does exist, you will update it. To accomplish this, you can use the findIndex() method. `findIndex` is an array method that lets find the index of the first element in an array that satisfies a given testing function. The `findIndex()` array method finds and returns the index of the first element in an array that meets the criteria specified by a provided testing function. If no such element is found, the method returns `-1`. Here's an example: ```js const numbers = [3, 1, 5, 6, 10, 9, 8]; const firstEvenNumIndex = numbers.findIndex((num) => num % 2 === 0); const numbers = [3, 1, 5, 6]; const firstNumLargerThanThree = numbers.findIndex((num) => num > 3); console.log(firstEvenNumIndex); // Output: 3 – because the first even number (6) is at index 3 console.log(firstNumLargerThanThree); // prints index 2 ``` Declare a `dataArrIndex` variable using `const` and set it to the result of the `findIndex()` method applied to the `taskData` array. Utilize arrow syntax to provide a callback function with `item` as the parameter, and within the callback, check if the `id` property of `item` is equal to the `id` property of `currentTask`. Use `const` to declare a variable called `dataArrIndex` and assign it the value of `taskData.findIndex()`. For the `findIndex()` method, pass in an arrow function with `item` as the parameter. If the task exists, this returns the index, and if it doesn't exist, it returns `-1`. Within the arrow function, check if the `id` property of `item` is strictly equal to the `id` property of `currentTask`. # --hints--"} +{"_id":"doc-en-freeCodeCamp-fc7c44a342a1d3a385a0935f0973ebcd69e0037d63288f78e97f077af5931d0d","title":"","text":"## --video-solution-- 1 2 "} +{"_id":"doc-en-freeCodeCamp-8045111be225a1d07a8c573e7d1088e45ad12396c91e9907c8c798f7a3c7098e","title":"","text":"# --description-- Use the `join()` method to combine the `songsHTML` markup into a single string. Right now the `songsHTML` is an array. If you tried to display this as is, you would see the songs separated by commas. This is not the desired outcome because you want to display the songs as a list. To fix this, you will need to join the array into a single string by using the join() method. The `join()` method is used to concatenate all the elements of an array into a single string. It takes an optional parameter called `separator` which is used to separate each element of the array. For example: The `join()` method is used to concatenate all the elements of an array into a single string. It takes an optional parameter called a `separator` which is used to separate each element of the array. For example: ```js const exampleArr = [\"This\", \"is\", \"a\", \"sentence\"];"} +{"_id":"doc-en-freeCodeCamp-160ed495487e683385e056f1ed1afaa38d9cff3c53aeefaa93710c1533abd705","title":"","text":"Chain the `join()` method to your `map()` method and pass in an empty string for the separator. To chain multiple methods together, you can call the `join()` method on the result of the `map()` method. For example: ```js array.map().join(); ``` # --hints-- You should add `join(\"\")` to the existing code."} +{"_id":"doc-en-freeCodeCamp-ed10a33452af196ceca5f25d187dcb2a90e2a9d7d602810e4266c10b4eefc2f2","title":"","text":"const getMultiple = await $.get(url + '?created_by=Alice&assigned_to=Bob'); assert.isArray(getMultiple); assert.lengthOf(getMultiple, 2); const copyId = getMultiple[0]._id; const getById = await $.get(url + `?_id=${copyId}`); assert.isArray(getById); assert.lengthOf(getById, 1); assert.equal(getById[0]._id, copyId, 'should be able to query a document by _id') } catch (err) { throw new Error(err.responseText || err.message); }"} +{"_id":"doc-en-freeCodeCamp-5a0f8e8cbf4a667d9f1c3328b9c0d2f597dfa46f9bb79a192bc7fe59e94eea02","title":"","text":"{currentCertTitles.map(title => ( ))} {t('settings.headings.legacy-certs')} {legacyCertTitles.map(title => ("} +{"_id":"doc-en-freeCodeCamp-3b87edae9bd7130d6e60a53f9f5619467c0f4fddec75b8d5a87c55a70eb610b0","title":"","text":"Create a `taskObj` object with an `id` property as the first property. For the value of the `id` property, retrieve the value of the `titleInput` field, convert it to lowercase, and then use the `split()` and `join()` methods to hyphenate it. Make sure all of those are in template literals because you need the `id` property value as a string. Make sure that the value of the `id` property is enclosed within template literals, as you will be appending more to the string later on. # --hints--"} +{"_id":"doc-en-freeCodeCamp-913e36761233a63e1dc234f5413b46b89c0b421dc4c9c8d7a98cccf88ca12445","title":"","text":"```js const player = new Player(); assert.match(player.update.toString(), /ifs*(s*this.position.ys*+s*this.heights*+s*this.velocity.ys*<=s*canvas.heights*)s*{s*}/); assert.match(player.update.toString(), /ifs*(s*(?:this.position.ys*+s*this.heights*+s*this.velocity.y|this.position.ys*+s*this.velocity.ys*+s*this.height|this.heights*+s*this.position.ys*+s*this.velocity.y|this.heights*+s*this.velocity.ys*+s*this.position.y|this.velocity.ys*+s*this.position.ys*+s*this.height|this.velocity.ys*+s*this.heights*+s*this.position.y)s*<=s*canvas.heights*)s*{s*}/); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-74be27b5f9bed9c475c3785f9f27118d05df7ae0e4cf768e289ec9e2d7bcea76","title":"","text":"console.log(greeting()); // Hello Anonymous ``` Add a new parameter to your `setPlayerCards` function called `arr` and assign it a default value of `players`. Add a new parameter to your `setPlayerCards` function called `arr` and assign it a default value of `players`. Remember that you destructured the `players` variable from the `myFavoriteFootballTeam` object on line `175`. # --hints--"} +{"_id":"doc-en-freeCodeCamp-dc020b2264604304319e86c6bdd66d1e2ffc0ecd6c39fe17c4c351d3c4d71ea2","title":"","text":"Before moving on, this is a great opportunity to learn a common array use. Currently, your code accesses the last element in the array with `rows[2]`. But you may not know how many elements are in an array when you want the last one. You can make use of the `.length` property of an array - this returns the number of elements in the array. For example, your `rows` array has 3 elements, so `rows.length` would be `3`. You can make use of the `.length` property of an array - this returns the number of elements in the array. To get the last element of any array, you can use the following syntax: Since you know the last element is at index `2`, you can compare that with the length of the array and see it is one less. The last element of an array will always be accessible at the index `length - 1`. You can use that in your bracket notation. ```js array[array.length - 1] ``` `array.length` returns the number of elements in the array. By subtracting `1`, you get the index of the last element in the array. You can apply this same concept to your `rows` array. Update your `rows[2]` to dynamically access the last element in the `rows` array. Refer to the example above to help you. Update your `rows[2]` to access the `rows.length - 1` index instead of the `2` index. You should not see anything change in your console. You should not see anything change in your console. # --hints--"} +{"_id":"doc-en-freeCodeCamp-e4e6e872e4246d9745b33e7b336dcddf13e858204be3943f2914085feb754a63","title":"","text":"```js let array = [1, 2, 3]; array[1] = 25; console.log(array); // prints [1, 25, 3] ``` Update the **third** element of your `rows` array to be the number `10`. Then print the `rows` array to your console."} +{"_id":"doc-en-freeCodeCamp-ccfbcc0fc3202ce0a1cc9639ff5875c2fb5fc2bf694d8264d8530c8df70c120f","title":"","text":"```js assert.match(code, /authorContainer.innerHTMLs*=s*(`|\"|').*

1/)
assert.match(code, /authorContainer.innerHTMLs*=s*(`|\"|')s*.*

s*1/)
``` Your `p` element should have the class `error-msg`. ```js assert.match(code, /(`|\"|')/) assert.match(code, /(`|\"|')s*/) ``` Your `p` element should have the text `There was an error loading the authors`. ```js assert.match(code, /(`|\"|')Theres+wass+ans+errors+loadings+thes+authors

1s*;?/)
assert.match(code, /(`|\"|')Theres+wass+ans+errors+loadings+thes+authors

s*1s*;?/)
```"} +{"_id":"doc-en-freeCodeCamp-34e80e61b14c472368242f16ffc3f44228f8eb3bb7af54bf0752f3f9698a72b0","title":"","text":"const state$ = { value: { challenge: { challengeMeta: { challengeType: 0 } }, app: { user: { username: 'test' } } app: { user: { username: 'test' }, allChallengesInfo: { challengeEdges: [], certificateNodes: [] } } } };"} +{"_id":"doc-en-freeCodeCamp-f104ed980acc6b837429c7e390cf5fb6e8fb249bd21297eb8b5f9f2c7aabcbc5","title":"","text":" import { createSelector } from 'reselect'; import { challengeTypes } from '../../../../../shared/config/challenge-types'; import { completedChallengesSelector,"} +{"_id":"doc-en-freeCodeCamp-e37f3b11ee32b9b0bb32e744861d797df7732d9a32f85f0a41dab2d460755cc4","title":"","text":"return challengeData; }; export const currentBlockIdsSelector = state => { const { block, certification, challengeType } = challengeMetaSelector(state); const allChallengesInfo = allChallengesInfoSelector(state); export const currentBlockIdsSelector = createSelector( challengeMetaSelector, allChallengesInfoSelector, (challengeMeta, allChallengesInfo) => { const { block, certification, challengeType } = challengeMeta; return getCurrentBlockIds( allChallengesInfo, block, certification, challengeType ); }; return getCurrentBlockIds( allChallengesInfo, block, certification, challengeType ); } ); export const completedChallengesInBlockSelector = state => { const completedChallengesIds = completedChallengesIdsSelector(state);"} +{"_id":"doc-en-freeCodeCamp-d89667f2a0d08f5458c99c21eb84afc2540cfcb1f34208efa183d18e8697a961","title":"","text":"); }; export const completedPercentageSelector = state => { const isSignedIn = isSignedInSelector(state); if (isSignedIn) { const completedChallengesIds = completedChallengesIdsSelector(state); const { id } = challengeMetaSelector(state); const currentBlockIds = currentBlockIdsSelector(state); const completedPercentage = getCompletedPercentage( completedChallengesIds, currentBlockIds, id ); return completedPercentage; } else return 0; }; export const completedPercentageSelector = createSelector( isSignedInSelector, completedChallengesSelector, challengeMetaSelector, currentBlockIdsSelector, (isSignedIn, completedChallenges, { id }, currentBlockIds) => { if (isSignedIn) { const completedPercentage = getCompletedPercentage( completedChallenges.map(node => node.id), currentBlockIds, id ); return completedPercentage; } else return 0; } ); export const isBlockNewlyCompletedSelector = state => { const completedPercentage = completedPercentageSelector(state);"} +{"_id":"doc-en-freeCodeCamp-34e25e57ef4894b78e7ca1a832a3bd3542d5da39a79ae3554d057b95f9497eff","title":"","text":"# --description-- For now, remove your first console log and your `rows[2]` assignment. Leave the second `rows` log statement for later. For now, remove your first console log and your `rows[rows.length - 1]` assignment. Leave the second `rows` log statement for later. # --hints--"} +{"_id":"doc-en-freeCodeCamp-8438cb8c61719eb7ee7491311a385d4b971b66bc9d402cc7a1ea98d3356b51c8","title":"","text":"assert.notMatch(code, /console.log(s*rows[s*0s*]s*)/); ``` You should remove your `rows[2]` reassignment. You should remove your `rows[rows.length - 1]` reassignment. ```js assert.notMatch(code, /rows[2]/); assert.notMatch(code, /rows[s*rows.lengths*-s*1s*]/); ``` You should not remove your `console.log(rows)` statement."} +{"_id":"doc-en-freeCodeCamp-6a15c7903e70a5d8bec2878af0bb790311a536ec018dac84f7785c13fc134df1","title":"","text":"--- # --description-- In your `highPrecedence` function, declare a variable using `const` and assign it a regex that checks if the string passed to the `str` parameter matches the pattern of a number followed by a `*` or `/` operator followed by another number. In your `highPrecedence` function, declare a `regex` variable. Assign it a regular expression that matches a number (including decimal numbers) followed by a `*` or `/` operator followed by another number. Each number, and the operator, should be in separate capture groups. Incorporate the regular expression you've defined into your `highPrecedence` function to test if the provided string `str` matches the pattern. Use the `test()` method on your `regex` variable and return the result. Your function should return a boolean value. Remember that you can use the `test()` method for this. # --hints-- You should declare a `regex` variable in your `highPrecedence` function. You should declare a variable in your `highPrecedence` function for your regex. ```js assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*(?:const|let|var)s+regex/); assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*(?:const|let|var)s+w+/); ``` You should use `const` to declare your `regex` variable. You should use `const` to declare your regex variable. ```js assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+regex/); assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+w+/); ``` Your `regex` variable should be a regular expression. Your regex variable should contain a regular expression. ```js assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+regexs*=s*//); assert.match(code, /consts+highPrecedences*=s*((s*strs*)|str)s*=>s*{s*consts+w+s*=s*//); ``` Your highPrecedence should return `regex.test(str);` Your `highPrecedence` function should return a boolean value. ```js assert.match(code, /returns+regex.test(str);?/); assert.isBoolean(highPrecedence(\"12*2\")); ``` Please enter a properly functioning regex. Your `highPrecedence` function should correctly check if the string matches the pattern of a number followed by a `*` or `/` operator followed by another number. ```js assert.strictEqual(highPrecedence(\"5*3\"), true); assert.isTrue(highPrecedence(\"5*3\")); assert.isFalse(highPrecedence(\"5\")); assert.isTrue(highPrecedence(\"10/2\")); assert.isFalse(highPrecedence(\"*\")); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-efb87cd6ffe1896a40e01e6a408815b89c772416a58bfbc9f29c5f9600be4fe1","title":"","text":"padding-bottom: 10px; } .help-modal-heading { line-height: 1.5; font-weight: 400; word-spacing: -0.4ch; } .help-form-legend { color: var(--secondary-color); border: 0;"} +{"_id":"doc-en-freeCodeCamp-898583c368b0ec565c4f7dfeb2f924c214505fcb7b34ec31cb85337a67854b6e","title":"","text":"text-align: left; } @media screen and (max-width: 767px) { .help-modal .btn-lg { font-size: 16px; } } .help-text-warning { text-align: left; }"} +{"_id":"doc-en-freeCodeCamp-9fb1c72caa22ccb03061133afe6f37139a7b8e0050fd889057e88a12974a9747","title":"","text":"\"order\": 1, \"superBlock\": \"project-euler\", \"disableLoopProtectTests\": true, \"disableLoopProtectPreview\": true, \"challengeOrder\": [ { \"id\": \"5900f3d21000cf542c50fee4\","} +{"_id":"doc-en-freeCodeCamp-b6a0b3a9ace86b713409272024b1639dd47aac3af9d70f4151bb3d081e7adb88","title":"","text":"Arrays have a special `length` property that allows you to see how many values, or elements, are in the array. You would access this property using syntax like `myArray.length`. Update your condition to check if `rows.length` is less than or equal to `count`. Note that `rows.length` in the `padRow` call would give you an off-by-one error, because `done` is incremented *before* the call. Update your condition to check if `rows.length` is less than `count`. # --hints-- Your `while` loop should check if `rows.length` is less than or equal to `count`. Your `while` loop should check if `rows.length` is less than `count`. ```js assert.match(__helpers.removeJSComments(code), /whiles*(s*rows.lengths*<=s*counts*)/); assert.match(__helpers.removeJSComments(code), /whiles*(s*rows.lengths* ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-def7725894d014dd3b4463286debf26cc0a4cfc2987c5c2debf0f482dc7d231f","title":"","text":"# --description-- You can also replace the `done` reference in your `padRow` call. Note that `rows.length` here would give you an off-by-one error, because `done` is incremented *before* the call. So you'll need to replace `done` here with `rows.length + 1`. When you do this, you may see a `Range Error`, because we've created another off-by-one error. You'll need to change the `while` condition to use the less than operator, instead of the less than or equal operator. Replace the `done` reference in your `padRow` call with `rows.length + 1`. # --hints--"} +{"_id":"doc-en-freeCodeCamp-a73a94fd0b0858d945bbf00249e9581f9baf7430f7656a5fea97ee96beac4b43","title":"","text":"assert.match(__helpers.removeJSComments(code), /rows.push(padRows*(s*rows.lengths*+s*1/); ``` Your `while` loop should run while `rows.length` is less than `count`. ```js assert.match(__helpers.removeJSComments(code), /whiles*(s*rows.lengths* # --seed-- ## --seed-contents--"} +{"_id":"doc-en-freeCodeCamp-e55c9c85eb22c5bbf657a9d69cf66ba1d87c640e5d314ac1b9944699e157708c","title":"","text":"--fcc-editable-region-- let done = 0; while (rows.length <= count) { while (rows.length < count) { done++; rows.push(padRow(done, count)); }"} +{"_id":"doc-en-freeCodeCamp-fe3971d5c5a17c54fab03db83cf855688604a8ecad5dc039c54d0d53ce11b753","title":"","text":"Your arrow function callback should check if `item.id === currentTask.id`. ```js assert.match(code, /consts+dataArrIndexs*=s*taskData.findIndex(s*((s*items*)|item)s*=>s*item.ids*===s*currentTask.ids*)s*;?/) assert.match(code, /consts+dataArrIndexs*=s*taskData.findIndex(s*((s*items*)|item)s*=>s*(?:item.ids*===s*currentTask.id|currentTask.ids*===s*item.id)s*)s*;?/) ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-85790875504555719ba598411aa2a1e255e970f518ad3c1ec981f4f451c51559","title":"","text":".fill-in-the-blank-wrap > p { margin: 0; font-size: 1.25em; font-size: 1.25rem; line-height: 1.5; } .fill-in-the-blank-input {"} +{"_id":"doc-en-freeCodeCamp-eaeb6fc3ac7840d39ae36e64a60c8c5cedae1aad650a124576780755b9af4e8f","title":"","text":"background-color: var(--primary-background); border-radius: 0; overflow-wrap: anywhere; line-height: 1.5rem; line-height: 1.5; z-index: 1; position: relative; border-left: none;"} +{"_id":"doc-en-freeCodeCamp-6bd553c18b39f0c00f7903bca4d8e1a813b7e065b28ec5fa3dc7a5473f4fe274","title":"","text":"border-bottom-color: var(--gray-45) !important; } .fill-in-the-blank-input:focus { z-index: 2; } .code-tag code { font-size: 100%; z-index: 0;"} +{"_id":"doc-en-freeCodeCamp-21abae0ed1c4a1f4a68a7c161ffec5026b7ca9f803070fbed96dd05db36f14be","title":"","text":"To begin, we will discuss a particular type of tree, the binary tree. In fact, we will actually discuss a particular binary tree, a binary search tree. Let's describe what this means. While the tree data structure can have any number of branches at a single node, a binary tree can only have two branches for every node. Furthermore, a binary search tree is ordered with respect to the child subtrees, such that the value of each node in the left subtree is less than or equal to the value of the parent node, and the value of each node in the right subtree is greater than or equal to the value of the parent node. It's very helpful to visualize this relationship in order to understand it better:
\"an
\"an
Now this ordered relationship is very easy to see. Note that every value to the left of 8, the root node, is less than 8, and every value to the right is greater than 8. Also notice that this relationship applies to each of the subtrees as well. For example, the first left child is a subtree. 3 is the parent node, and it has exactly two child nodes — by the rules governing binary search trees, we know without even looking that the left child of this node (and any of its children) will be less than 3, and the right child (and any of its children) will be greater than 3 (but also less than the structure's root value), and so on."} +{"_id":"doc-en-freeCodeCamp-2315b4ef19497b79fd9072d00d9bc6e7302f128045298c338ff3f5afb606a3fb","title":"","text":"# --description-- Add a `title` and a `meta` element to the `head`. Give your project a title of `Registration Form`, and give a `charset` attribute with a value of `UTF-8` to your `meta` element. Add a `title` and `meta` element inside the `head` element. Give your project a title of `Registration Form`, and add the `charset` attribute with a value of `utf-8` to your `meta` element. # --hints--"} +{"_id":"doc-en-freeCodeCamp-cfad913f5a252a93a0ebead4382986a11846404c5fab67af548bf667b43ce998","title":"","text":"assert.exists(title); ``` The `title` element should be within the `head` element. Your `title` element should be within the `head` element. ```js assert.exists(document.querySelector('head > title')); ``` Your project should have a title of `Registration Form`. Your project should have a title of `Registration Form`. Remember, the casing and spelling matters for the title. ```js const title = document.querySelector('title'); assert.equal(title.text.toLowerCase(), 'registration form') assert.equal(title.text, 'Registration Form'); ``` Remember, the casing and spelling matters for the title. You should create a `meta` element within the `head` element. ```js const title = document.querySelector('title'); assert.equal(title.text, 'Registration Form'); assert.exists(document.querySelector('head > meta')); ``` You should give the `meta` element a `charset` attribute with the value of `utf-8`. ```js assert.equal(document.querySelector('head > meta')?.getAttribute('charset')?.toLowerCase(), 'utf-8'); ``` Your `meta` element should be a void element, it does not have an end tag ``. ```js assert.notMatch(code, /?/i); ``` # --seed--"} +{"_id":"doc-en-freeCodeCamp-da555af26372259e585a5908c742748ea731b87741e5544bd19f9fb6c2d0115e","title":"","text":"The HSL color model, or hue, saturation, and lightness, is another way to represent colors. The CSS hsl function accepts 3 values: a number from 0 to 360 for hue, a percentage from 0 to 100 for saturation, and a percentage from 0 to 100 for lightness. The CSS `hsl` function accepts 3 values: a number from 0 to 360 for hue, a percentage from 0 to 100 for saturation, and a percentage from 0 to 100 for lightness. If you imagine a color wheel, the hue red is at 0 degrees, green is at 120 degrees, and blue is at 240 degrees."} +{"_id":"doc-en-freeCodeCamp-05d087f38d306ac5ffc4b0071ccfbc5e91fd01312d58586737fd857cd694bf24","title":"","text":"Now you need to create a `draw` method for the `CheckPoint` class. Inside the `draw` method, add a `fillStyle` property to the `ctx` object and set it to `\"#f1be32\"`. Inside the `draw` method, assign the `fillStyle` property on the `ctx` object the hex color `\"#f1be32\"`. Below the `fillStyle` property, use the `fillRect` method on the `ctx` object and pass in the `x`, `y`, `width`, and `height` properties as arguments."} +{"_id":"doc-en-freeCodeCamp-ee0367aa6d2082589bcf167429860d7b8e911c4385da8e7219a8aff953d61821","title":"","text":"Your `CheckPoint` class should have a `draw` method. ```js const splitter = code.split(\"ctx.fillRect(this.position.x, this.position.y, this.width, this.height)\") assert.match(splitter[2], /draw(s*)s*{/); const splitter = code.split(\"ctx.fillRect(this.position.x, this.position.y, this.width, this.height)\"); assert.match(splitter[2], /draws*(s*)s*{/); ``` Your `draw` method should have a `fillStyle` property added to the `ctx` object. Your `draw` method should assign a value to the `fillStyle` property on the `ctx` object. ```js const splitter = code.split(\"ctx.fillRect(this.position.x, this.position.y, this.width, this.height)\") assert.match(splitter[2], /draw(s*)s*{s*ctx.fillStyle/); const splitter = code.split(\"ctx.fillRect(this.position.x, this.position.y, this.width, this.height)\"); assert.match(splitter[2], /draws*(s*)s*{s*ctx.fillStyles*=/); ``` You should assign `\"#f1be32\"` to the `ctx.fillStyle` property. You should assign the hex color `\"#f1be32\"` to the `fillStyle` property on the `ctx` object. ```js const splitter = code.split(\"ctx.fillRect(this.position.x, this.position.y, this.width, this.height)\") assert.match(splitter[2], /draw(s*)s*{s*ctx.fillStyles*=s*('|\")#f1be321s*;?/); const splitter = code.split(\"ctx.fillRect(this.position.x, this.position.y, this.width, this.height)\"); assert.match(splitter[2], /draws*(s*)s*{s*ctx.fillStyles*=s*('|\")#f1be321s*;?/); ``` Your `draw` method should invoke the `fillRect` method on the `ctx` object. ```js const splitter = code.split('#f1be32') const splitter = code.split('#f1be32'); assert.match(splitter[1], /ctx.fillRect(/); ``` When invoking `ctx.fillRect` you should pass in the `x`, `y`, `width`, and `height` properties as arguments. Don't forget the `this` keyword. When invoking `ctx.fillRect` you should pass in the `position.x`, `position.y`, `width`, and `height` properties as arguments. Don't forget the `this` keyword. ```js const splitter = code.split('#f1be32') const splitter = code.split('#f1be32'); assert.match(splitter[1], /ctx.fillRect(s*this.position.xs*,s*this.position.ys*,s*this.widths*,s*this.heights*)s*;?/); ```"} +{"_id":"doc-en-freeCodeCamp-e07d9294e308f11360064125768c6451d6389f8b3e6b9799baea0edffa302942","title":"","text":"assert(document.querySelector(\"fieldset:nth-of-type(3) input:nth-of-type(5)[type='checkbox']\")); ``` You should have an checkbox input with an `id` of `\"price\"`. You should have a checkbox input with an `id` of `\"price\"`. ```js assert.strictEqual(document.querySelectorAll(\"fieldset:nth-of-type(3) input[type='checkbox']\")[4].getAttribute('id'), 'price');"} +{"_id":"doc-en-freeCodeCamp-d9bf6f941ad52808c760da4487f5ad8b7d186c1d1098f699cbebea83ecb3c4ab","title":"","text":"# --description-- To make an checkbox input checked by default, you can add the `checked` attribute. To make a checkbox input checked by default, you can add the `checked` attribute. Here is an example of using the `checked` attribute:"}