diff --git a/README.md b/README.md
index ca3d1b8f4c..64c5a90c16 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
Welcome to Free Code Camp's open source codebase and curriculum!
=======================
-Free Code Camp is a friendly open-source community where you learn to code and help nonprofits.
+Free Code Camp is a friendly open source community where you learn to code and help nonprofits.
**We help our campers build job-worthy portfolios of real apps used by real people, while helping nonprofits.**
diff --git a/client/commonFramework/display-test-results.js b/client/commonFramework/display-test-results.js
index f30790fddb..a925b3b213 100644
--- a/client/commonFramework/display-test-results.js
+++ b/client/commonFramework/display-test-results.js
@@ -2,6 +2,7 @@ window.common = (function({ $, common = { init: [] }}) {
common.displayTestResults = function displayTestResults(data = []) {
$('#testSuite').children().remove();
+ $('#testSuite').fadeIn('slow');
data.forEach(({ err = false, text = '' }) => {
var iconClass = err ?
'"ion-close-circled big-error-icon"' :
@@ -20,7 +21,7 @@ window.common = (function({ $, common = { init: [] }}) {
`)
.appendTo($('#testSuite'));
});
-
+ $('#scroll-locker').animate({ scrollTop: $(document).height() }, 'slow');
return data;
};
diff --git a/client/commonFramework/end.js b/client/commonFramework/end.js
index b2a6b09a67..1a841de50c 100644
--- a/client/commonFramework/end.js
+++ b/client/commonFramework/end.js
@@ -89,6 +89,7 @@ $(document).ready(function() {
common.submitBtn$
)
.flatMap(() => {
+ $('#testSuite').fadeOut('slow');
common.appendToOutputDisplay('\n// testing challenge...');
return common.executeChallenge$()
.map(({ tests, ...rest }) => {
diff --git a/config/secrets.js b/config/secrets.js
index ed369d9766..36b3a50980 100644
--- a/config/secrets.js
+++ b/config/secrets.js
@@ -4,20 +4,6 @@ module.exports = {
sessionSecret: process.env.SESSION_SECRET,
- trello: {
- key: process.env.TRELLO_KEY,
- secret: process.env.TRELLO_SECRET
- },
-
- blogger: {
- key: process.env.BLOGGER_KEY
- },
-
- mandrill: {
- user: process.env.MANDRILL_USER,
- password: process.env.MANDRILL_PASSWORD
- },
-
facebook: {
clientID: process.env.FACEBOOK_ID,
clientSecret: process.env.FACEBOOK_SECRET,
diff --git a/pm2Start.js b/pm2Start.js
index b0755e4b34..f648b756ad 100644
--- a/pm2Start.js
+++ b/pm2Start.js
@@ -7,16 +7,6 @@ var _ = require('lodash');
var instances = process.env.INSTANCES || 1;
var serverName = process.env.SERVER_NAME || 'server';
var maxMemory = process.env.MAX_MEMORY || '390M';
-var transportOptions = {
- type: 'smtp',
- service: 'Mandrill',
- auth: {
- user: process.env.MANDRILL_USER || false,
- pass: process.env.MANDRILL_PASSWORD
- }
-};
-
-var mailReceiver = process.env.MAIL_RECEIVER || false;
pm2.connect(function() {
pm2.start({
@@ -36,46 +26,3 @@ pm2.connect(function() {
pm2.disconnect();
});
});
-
-
-if (transportOptions.auth.user && mailReceiver) {
- console.log('setting up mailer');
- var transporter = nodemailer.createTransport(transportOptions);
- var compiled = _.template(
- 'An error has occurred on server ' +
- '<% name %>\n' +
- 'Stack Trace:\n\n\n<%= stack %>\n\n\n' +
- 'Context:\n\n<%= text %>'
- );
-
- pm2.launchBus(function(err, bus) {
- if (err) {
- return console.error(err);
- }
- console.log('event bus connected');
-
- bus.on('process:exception', function(data) {
- var text;
- var stack;
- var name;
- try {
- data.date = moment(data.at || new Date())
- .tz('America/Los_Angeles')
- .format('MMMM Do YYYY, h:mm:ss a z');
-
- text = JSON.stringify(data, null, 2);
- stack = data.data.stack;
- name = data.process.name;
- } catch (e) {
- return e;
- }
-
- transporter.sendMail({
- to: mailReceiver,
- from: 'team@freecodecamp.com',
- subject: 'Server exception',
- text: compiled({ name: name, text: text, stack: stack })
- });
- });
- });
-}
diff --git a/sample.env b/sample.env
index 776ce78955..df17ed114c 100644
--- a/sample.env
+++ b/sample.env
@@ -12,9 +12,6 @@ GOOGLE_SECRET=stuff
LINKEDIN_ID=stuff
LINKEDIN_SECRET=stuff
-MANDRILL_PASSWORD=stuff
-MANDRILL_USER=stuff
-
TWITTER_KEY=stuff
TWITTER_SECRET=stuff
TWITTER_TOKEN=stuff
diff --git a/seed/bonfireMDNlinks.js b/seed/bonfireMDNlinks.js
index 12d13e26ab..2c5087e453 100644
--- a/seed/bonfireMDNlinks.js
+++ b/seed/bonfireMDNlinks.js
@@ -38,46 +38,46 @@ var links = {
// ========== OBJECT METHODS
"Object.getOwnPropertyNames()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames",
"Object.keys()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys",
- "Object.hasOwnProperty()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty",
+ "Object.prototype.hasOwnProperty()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty",
// ======== STRING METHODS
- "String.charAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt",
+ "String.prototype.charAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt",
"String.prototype.charCodeAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt",
- "String.concat()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat",
- "String.indexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf",
+ "String.prototype.concat()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat",
+ "String.prototype.indexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf",
"String.fromCharCode()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode",
- "String.lastIndexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf",
- "String.match()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match",
- "String.replace()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace",
- "String.slice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice",
- "String.split()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split",
- "String.substring()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring",
- "String.substr()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr",
- "String.toLowerCase()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase",
- "String.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toString",
- "String.toUpperCase()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase",
+ "String.prototype.lastIndexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf",
+ "String.prototype.match()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match",
+ "String.prototype.replace()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace",
+ "String.prototype.slice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice",
+ "String.prototype.split()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split",
+ "String.prototype.substring()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring",
+ "String.prototype.substr()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr",
+ "String.prototype.toLowerCase()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase",
+ "String.prototype.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toString",
+ "String.prototype.toUpperCase()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase",
// ======== ARRAY METHODS
- "Array.concat()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat",
- "Array.every()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every",
- "Array.filter()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter",
- "Array.forEach()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach",
- "Array.indexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf",
+ "Array.prototype.concat()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat",
+ "Array.prototype.every()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every",
+ "Array.prototype.filter()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter",
+ "Array.prototype.forEach()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach",
+ "Array.prototype.indexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf",
"Array.isArray()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray",
- "Array.join()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join",
- "Array.lastIndexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf",
- "Array.map()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map",
- "Array.pop()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop",
- "Array.push()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push",
- "Array.reduce()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce",
- "Array.reverse()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse",
- "Array.shift()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift",
- "Array.slice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice",
- "Array.some()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some",
- "Array.sort()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort",
- "Array.splice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
- "Array.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
+ "Array.prototype.join()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join",
+ "Array.prototype.lastIndexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf",
+ "Array.prototype.map()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map",
+ "Array.prototype.pop()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop",
+ "Array.prototype.push()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push",
+ "Array.prototype.reduce()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce",
+ "Array.prototype.reverse()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse",
+ "Array.prototype.shift()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift",
+ "Array.prototype.slice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice",
+ "Array.prototype.some()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some",
+ "Array.prototype.sort()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort",
+ "Array.prototype.splice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
+ "Array.prototype.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
// ======== STATEMENTS AND DECLARATIONS
"Switch Statement": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch",
@@ -86,7 +86,7 @@ var links = {
"Math.max()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max",
"Math.min()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min",
"Math.pow()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow",
- "Remainder": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder_(.25)",
+ "Remainder": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder",
// ======== GENERAL JAVASCRIPT REFERENCES
"Arithmetic Operators": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators",
diff --git a/seed/challenges/00-getting-started/getting-started.json b/seed/challenges/00-getting-started/getting-started.json
index 80f6e0e245..e994de1857 100644
--- a/seed/challenges/00-getting-started/getting-started.json
+++ b/seed/challenges/00-getting-started/getting-started.json
@@ -649,19 +649,19 @@
},
{
"id": "560add71cb82ac38a17513c2",
- "title": "Join a Campsite in Your City",
+ "title": "Join a Free Code Camp Group in Your City",
"description": [
[
"//i.imgur.com/XugIMb4.jpg",
"A picture of some of our campers meeting in a local cafe.",
- "Our Campsites are Facebook groups that help you meet other campers in your city. You can use these groups to plan and attend casual \"coffee-and-code\" events, where you meet other campers at a café and code together.",
+ "You can code together with other campers in your city by joining a local Free Code Camp group.",
""
],
[
"//i.imgur.com/fTFMjwf.gif",
- "A gif showing how you can click the link below, find your city on the list of Campsites, then click on the Facebook link for your city and join your city's Facebook group.",
- "Find your city on this list and click it. This will take you to your city's Campsite's Facebook group. Click the \"Join group\" button to apply to join your city's Facebook group. Someone from the campsite should approve you shortly. If your city isn't on this list, scroll to the top of the wiki article for instructions for how you can create your city's Campsite.",
- "https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/LocalGroups-List"
+ "A gif showing how you can click the link below, find your city on the list of local groups.",
+ "Find your city on this list and click it. This will take you to its Facebook page. Click the \"Join group\" button. Someone from the group should approve you shortly. If your city isn't on this list, scroll to the top of the wiki article for instructions on how you can start a group in your city.",
+ "https://www.freecodecamp.com/wiki/en/localgroups-list/"
]
],
"challengeSeed": [],
diff --git a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json
index 4c30428214..fa82190d7c 100644
--- a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json
+++ b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json
@@ -25,7 +25,7 @@
"telephoneCheck(\"555-555-5555\");"
],
"solutions": [
- "var re = /^(?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:\\(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*\\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$/;\n\nfunction telephoneCheck(str) {\n return !!str.match(re);\n}\n\ntelephoneCheck(\"555-555-5555\");"
+ "var re = /^([+]?1[\\s]?)?((?:[(](?:[2-9]1[02-9]|[2-9][02-8][0-9])[)][\\s]?)|(?:(?:[2-9]1[02-9]|[2-9][02-8][0-9])[\\s.-]?)){1}([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2}[\\s.-]?){1}([0-9]{4}){1}$/;\n\nfunction telephoneCheck(str) {\n return re.test(str);\n}\n\ntelephoneCheck(\"555-555-5555\");"
],
"tests": [
"assert(typeof telephoneCheck(\"555-555-5555\") === \"boolean\", 'message: telephoneCheck(\"555-555-5555\")
should return a boolean.');",
@@ -35,6 +35,8 @@
"assert(telephoneCheck(\"555-555-5555\") === true, 'message: telephoneCheck(\"555-555-5555\")
should return true.');",
"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(\"555-5555\") === false, 'message: telephoneCheck(\"555-5555\")
should return false.');",
+ "assert(telephoneCheck(\"5555555\") === false, 'message: telephoneCheck(\"5555555\")
should return false.');",
"assert(telephoneCheck(\"1 555)555-5555\") === false, 'message: telephoneCheck(\"1 555)555-5555\")
should return false.');",
"assert(telephoneCheck(\"1 555 555 5555\") === true, 'message: telephoneCheck(\"1 555 555 5555\")
should return true.');",
"assert(telephoneCheck(\"1 456 789 4444\") === true, 'message: telephoneCheck(\"1 456 789 4444\")
should return true.');",
@@ -51,7 +53,8 @@
"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.');",
+ "assert(telephoneCheck(\"(555)5(55?)-5555\") === false, 'message: telephoneCheck(\"(555)5(55?)-5555\")
should return false.');"
],
"type": "bonfire",
"MDNlinks": [
@@ -99,7 +102,7 @@
],
"type": "bonfire",
"MDNlinks": [
- "Array.reduce()",
+ "Array.prototype.reduce()",
"Symmetric Difference"
],
"challengeType": 5,
@@ -297,8 +300,8 @@
],
"type": "bonfire",
"MDNlinks": [
- "String.split()",
- "String.substr()",
+ "String.prototype.split()",
+ "String.prototype.substr()",
"parseInt()"
],
"challengeType": 5,
@@ -436,7 +439,7 @@
],
"type": "bonfire",
"MDNlinks": [
- "Array.reduce()"
+ "Array.prototype.reduce()"
],
"challengeType": 5,
"titleEs": "En parejas",
diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json
index df254b7765..c1e26aaa33 100644
--- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json
+++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json
@@ -95,9 +95,9 @@
],
"MDNlinks": [
"Global String Object",
- "String.split()",
- "Array.reverse()",
- "Array.join()"
+ "String.prototype.split()",
+ "Array.prototype.reverse()",
+ "Array.prototype.join()"
],
"challengeType": 5,
"titleEs": "Invierte el texto",
@@ -158,6 +158,7 @@
"A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.",
"Note
You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything lower case in order to check for palindromes.",
"We'll pass strings with varying formats, such as \"racecar\"
, \"RaceCar\"
, and \"race CAR\"
among others.",
+ "We'll also pass strings with special symbols, such as \"2A3*3a2\"
, \"2A3 3a2\"
, and \"2_A3*3#A2\"
.",
"Remember to use Read-Search-Ask if you get stuck. Write your own code."
],
"challengeSeed": [
@@ -173,6 +174,7 @@
"tests": [
"assert(typeof palindrome(\"eye\") === \"boolean\", 'message: palindrome(\"eye\")
should return a boolean.');",
"assert(palindrome(\"eye\") === true, 'message: palindrome(\"eye\")
should return true.');",
+ "assert(palindrome(\"_eye\") === true, 'message: palindrome(\"_eye\")
should return true.');",
"assert(palindrome(\"race car\") === true, 'message: palindrome(\"race car\")
should return true.');",
"assert(palindrome(\"not a palindrome\") === false, 'message: palindrome(\"not a palindrome\")
should return false.');",
"assert(palindrome(\"A man, a plan, a canal. Panama\") === true, 'message: palindrome(\"A man, a plan, a canal. Panama\")
should return true.');",
@@ -190,8 +192,8 @@
"function palindrome(str) {\n var string = str.toLowerCase().split(/[^A-Za-z0-9]/gi).join('');\n var aux = string.split('');\n if (aux.join('') === aux.reverse().join('')){\n return true;\n }\n\n return false;\n}"
],
"MDNlinks": [
- "String.replace()",
- "String.toLowerCase()"
+ "String.prototype.replace()",
+ "String.prototype.toLowerCase()"
],
"challengeType": 5,
"titleEs": "Verifica si es palíndromo",
@@ -232,7 +234,7 @@
"function findLongestWord(str) {\n return str.split(' ').sort(function(a, b) { return b.length - a.length;})[0].length;\n}\n\nfindLongestWord('The quick brown fox jumped over the lazy dog');\n"
],
"MDNlinks": [
- "String.split()",
+ "String.prototype.split()",
"String.length"
],
"challengeType": 5,
@@ -270,7 +272,7 @@
"function titleCase(str) {\n return str.split(' ').map(function(word) {\n return word.charAt(0).toUpperCase() + word.substring(1).toLowerCase();\n }).join(' ');\n}\n\ntitleCase(\"I'm a little tea pot\");\n"
],
"MDNlinks": [
- "String.split()"
+ "String.prototype.split()"
],
"challengeType": 5,
"titleEs": "Aplica formato de título",
@@ -349,7 +351,7 @@
"function confirmEnding(str, target) {\n return str.substring(str.length-target.length) === target;\n};\n"
],
"MDNlinks": [
- "String.substr()"
+ "String.prototype.substr()"
],
"challengeType": 5,
"titleEs": "Confirma la terminación",
@@ -427,7 +429,7 @@
"function truncateString(str, num) {\n if(str.length > num ) {\n if(num > 3) {\n return str.slice(0, num - 3) + '...';\n } else {\n return str.slice(0,num) + '...';\n }\n } \n return str;\n}"
],
"MDNlinks": [
- "String.slice()"
+ "String.prototype.slice()"
],
"challengeType": 5,
"titleEs": "Trunca una cadena de texto",
@@ -468,8 +470,8 @@
"function chunkArrayInGroups(arr, size) {\n var out = [];\n for (var i = 0; i < arr.length; i+=size) {\n out.push(arr.slice(i,i+size));\n }\n return out;\n}\n\nchunkArrayInGroups(['a', 'b', 'c', 'd'], 2);\n"
],
"MDNlinks": [
- "Array.push()",
- "Array.slice()"
+ "Array.prototype.push()",
+ "Array.prototype.slice()"
],
"challengeType": 5,
"titleEs": "En mil pedazos",
@@ -508,8 +510,8 @@
"function slasher(arr, howMany) {\n // it doesn't always pay to be first\n return arr.slice(howMany);\n}\n\nslasher([1, 2, 3], 2);\n"
],
"MDNlinks": [
- "Array.slice()",
- "Array.splice()"
+ "Array.prototype.slice()",
+ "Array.prototype.splice()"
],
"challengeType": 5,
"titleEs": "Vuélale la cabeza",
@@ -553,7 +555,7 @@
"function mutation(arr) {\n var hash = Object.create(null);\n arr[0].toLowerCase().split('').forEach(function(c) {\n hash[c] = true;\n });\n return !arr[1].toLowerCase().split('').filter(function(c) {\n return !hash[c];\n }).length;\n}\n\nmutation(['hello', 'hey']);\n"
],
"MDNlinks": [
- "String.indexOf()"
+ "String.prototype.indexOf()"
],
"challengeType": 5,
"titleEs": "Mutaciones",
@@ -594,7 +596,7 @@
],
"MDNlinks": [
"Boolean Objects",
- "Array.filter()"
+ "Array.prototype.filter()"
],
"challengeType": 5,
"titleEs": "Detector de mentiras",
@@ -633,7 +635,7 @@
],
"MDNlinks": [
"Arguments object",
- "Array.filter()"
+ "Array.prototype.filter()"
],
"challengeType": 5,
"titleEs": "Buscar y destruir",
@@ -674,7 +676,7 @@
"function getIndexToIns(arr, num) {\n arr = arr.sort(function(a, b){return a-b;});\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] >= num)\n {\n return i;\n }\n }\n return arr.length;\n}"
],
"MDNlinks": [
- "Array.sort()"
+ "Array.prototype.sort()"
],
"challengeType": 5,
"titleEs": "¿Cuál es mi asiento?",
diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json
index 0e824133ca..2cb9c20b33 100644
--- a/seed/challenges/01-front-end-development-certification/basic-javascript.json
+++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json
@@ -1036,10 +1036,14 @@
"title": "Escape Sequences in Strings",
"description": [
"Quotes are not the only characters that can be escaped inside a string. Here is a table of common escape sequences:",
- "
Code | Output |
---|
\\' | single quote |
\\\" | double quote |
\\\\ | backslash |
\\n | new line |
\\r | carriage return |
\\t | tab |
\\b | backspace |
\\f | form feed |
",
+ "Code | Output |
---|
\\' | single quote |
\\\" | double quote |
\\\\ | backslash |
\\n | new line |
\\r | carriage return |
\\t | tab |
\\b | backspace |
\\f | form feed |
",
"Note that the backslash itself must be escaped in order to display as a backslash.",
"Instructions
",
- "Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line
and assign it to myStr
"
+ "Assign the following two lines of text into the single variable myStr
using escape sequences.",
+ "Here is a backslash: \\.
Here is a new line with two tabs.
",
+ "You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above with no additional spaces between each escape sequence.",
+ "Here is the text with the escape sequences written out.",
+ "Here is a backslash: backslash
.newline
tab
tab
Here is a new line with two tabs.
"
],
"releasedOn": "January 1, 2016",
"challengeSeed": [
@@ -1054,10 +1058,14 @@
"else{return null;}})();"
],
"solutions": [
- "var myStr = \"\\\\ \\t \\t \\r \\n\";"
+ "var myStr = \"Here is a backslash: \\\\.\\n\\t\\tHere is a new line with two tabs.\";"
],
"tests": [
- "assert(myStr === \"\\\\ \\t \\t \\r \\n\", 'message: myStr
should have the escape sequences for backslash tab tab carriage-return new-line
separated by spaces');"
+ "assert(myStr === \"Here is a backslash: \\\\.\\n\\t\\tHere is a new line with two tabs.\", 'message: myStr
should have encoded text with the proper escape sequences and spacing.');",
+ "assert(myStr.match(/\\t/g).length == 2, 'message: myStr
should have two tab characters \\t
');",
+ "assert(myStr.match(/\\n/g).length == 1, 'message: myStr
should have one newline character \\n
');",
+ "assert(myStr.match(/\\\\/g).length == 1, 'message: myStr
should have a correctly escaped backslash character \\\\
');",
+ "assert(myStr === \"Here is a backslash: \\\\.\\n\\t\\tHere is a new line with two tabs.\", 'message: myStr
should not have any spaces in between consecutive escape sequences.');"
],
"type": "waypoint",
"challengeType": 1,
@@ -1263,7 +1271,7 @@
],
"tests": [
"assert(typeof someAdjective !== 'undefined' && someAdjective.length > 2, 'message: someAdjective
should be set to a string at least 3 characters long');",
- "assert(code.match(/\\w\\s*\\+=\\s*someAdjective\\s*;/).length > 0, 'message: Append someAdjective
to myStr
using the +=
operator');"
+ "assert(code.match(/myStr\\s*\\+=\\s*someAdjective\\s*/).length > 0, 'message: Append someAdjective
to myStr
using the +=
operator');"
],
"type": "waypoint",
"challengeType": 1,
@@ -1551,7 +1559,7 @@
"description": [
"We will now use our knowledge of strings to build a \"Mad Libs\" style word game we're calling \"Word Blanks\". You will create an (optionally humorous) \"Fill in the Blanks\" style sentence.",
"You will need to use string operators to build a new string, result
, using the provided variables: myNoun
, myAdjective
, myVerb
, and myAdverb
.",
- "You will also need to provide additional strings, which will not change, in between the provided words.",
+ "You will also need to use additional strings, which will not change, and must be in between all of the provided words. The output should be a complete sentence.",
"We have provided a framework for testing your results with different words. The tests will run your function with several different inputs to make sure all of the provided words appear in the output, as well as your extra strings."
],
"releasedOn": "January 1, 2016",
@@ -1577,8 +1585,8 @@
],
"tests": [
"assert(typeof wordBlanks(\"\",\"\",\"\",\"\") === 'string', 'message: wordBlanks(\"\",\"\",\"\",\"\")
should return a string.');",
- "assert(/\\bdog\\b/.test(test1) && /\\bbig\\b/.test(test1) && /\\bran\\b/.test(test1) && /\\bquickly\\b/.test(test1),'message: wordBlanks(\"dog\", \"big\", \"ran\", \"quickly\")
should contain all of the passed words separated by non-word characters (and any additional words in your madlib).');",
- "assert(/\\bcat\\b/.test(test2) && /\\blittle\\b/.test(test2) && /\\bhit\\b/.test(test2) && /\\bslowly\\b/.test(test2),'message: wordBlanks(\"cat\", \"little\", \"hit\", \"slowly\")
should contain all of the passed words separated by non-word characters (and any additional words in your madlib).');"
+ "assert(/\\bdog\\b/.test(test1) && /\\bbig\\b/.test(test1) && /\\bran\\b/.test(test1) && /\\bquickly\\b/.test(test1),'message: wordBlanks(\"dog\", \"big\", \"ran\", \"quickly\")
should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).');",
+ "assert(/\\bcat\\b/.test(test2) && /\\blittle\\b/.test(test2) && /\\bhit\\b/.test(test2) && /\\bslowly\\b/.test(test2),'message: wordBlanks(\"cat\", \"little\", \"hit\", \"slowly\")
should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).');"
],
"type": "checkpoint",
"challengeType": 1,
@@ -1595,9 +1603,10 @@
"title": "Store Multiple Values in one Variable using JavaScript Arrays",
"description": [
"With JavaScript array
variables, we can store several pieces of data in one place.",
- "You start an array declaration with an opening square bracket, end it with a closing square bracket, and put a comma between each entry, like this:
var sandwich = [\"peanut butter\", \"jelly\", \"bread\"]
.",
+ "You start an array declaration with an opening square bracket, end it with a closing square bracket, and put a comma between each entry, like this: ",
+ "var sandwich = [\"peanut butter\", \"jelly\", \"bread\"]
.",
"Instructions
",
- "Create a new array called myArray
that contains both a string
and a number
(in that order).",
+ "Modify the new array myArray
so that it contains both a string
and a number
(in that order).",
"Hint
Refer to the example code in the text editor if you get stuck."
],
"challengeSeed": [
@@ -1673,7 +1682,7 @@
"Example",
"var array = [1,2,3];
array[0]; // equals 1
var data = array[1]; // equals 2
",
"Instructions
",
- "Create a variable called myData
and set it to equal the first value of myArray
."
+ "Create a variable called myData
and set it to equal the first value of myArray
using bracket notation."
],
"challengeSeed": [
"// Example",
@@ -1693,7 +1702,8 @@
"var myArray = [1,2,3];\nvar myData = myArray[0];"
],
"tests": [
- "assert((function(){if(typeof myArray != 'undefined' && typeof myData != 'undefined' && myArray[0] === myData){return true;}else{return false;}})(), 'message: The variable myData
should equal the first value of myArray
.');"
+ "assert((function(){if(typeof myArray !== 'undefined' && typeof myData !== 'undefined' && myArray[0] === myData){return true;}else{return false;}})(), 'message: The variable myData
should equal the first value of myArray
.');",
+ "assert((function(){if(code.match(/\\s*=\\s*myArray\\[0\\]/g)){return true;}else{return false;}})(), 'message: The data in variable myArray
should be accessed using bracket notation.');"
],
"type": "waypoint",
"challengeType": 1,
@@ -1867,7 +1877,8 @@
"var myArray = [[\"John\", 23], [\"cat\", 2]];\nvar removedFromMyArray = myArray.pop();"
],
"tests": [
- "assert((function(d){if(d[0][0] == 'John' && d[0][1] == 23 && d[2] == undefined){return true;}else{return false;}})(myArray), 'message: myArray
should only contain [[\"John\", 23]]
.');",
+ "assert((function(d){if(d[0][0] == 'John' && d[0][1] == 23 && d[1] == undefined){return true;}else{return false;}})(myArray), 'message: myArray
should only contain [[\"John\", 23]]
.');",
+ "assert(/removedFromMyArray\\s*=\\s*myArray\\s*.\\s*pop\\s*(\\s*)/.test(code), 'message: Use pop()
on myArray
');",
"assert((function(d){if(d[0] == 'cat' && d[1] == 2 && d[2] == undefined){return true;}else{return false;}})(removedFromMyArray), 'message: removedFromMyArray
should only contain [\"cat\", 2]
.');"
],
"type": "waypoint",
@@ -2042,19 +2053,7 @@
"Instructions
",
"- Create a function called
reusableFunction
which prints \"Hi World\"
to the dev console. - Call the function.
"
],
- "challengeSeed": [
- "// Example",
- "function reusableFunction() {",
- " console.log(\"Heyya, World\");",
- "}",
- "",
- "reusableFunction();",
- "",
- "// Only change code below this line",
- "",
- ""
- ],
- "tail": [
+ "head": [
"var logOutput = \"\";",
"var originalConsole = console",
"function capture() {",
@@ -2074,12 +2073,26 @@
" console.log = originalConsole.log;",
"}",
"",
+ "capture();"
+ ],
+ "challengeSeed": [
+ "// Example",
+ "function reusableFunction() {",
+ " console.log(\"Heyya, World\");",
+ "}",
+ "",
+ "reusableFunction();",
+ "",
+ "// Only change code below this line",
+ "",
+ ""
+ ],
+ "tail": [
+ "uncapture();",
+ "",
"if (typeof reusableFunction !== \"function\") { ",
" (function() { return \"reusableFunction is not defined\"; })();",
"} else {",
- " capture();",
- " reusableFunction(); ",
- " uncapture();",
" (function() { return logOutput || \"console.log never called\"; })();",
"}"
],
@@ -2690,7 +2703,7 @@
"assert(testEqual(10) === \"Not Equal\", 'message: testEqual(10)
should return \"Not Equal\"');",
"assert(testEqual(12) === \"Equal\", 'message: testEqual(12)
should return \"Equal\"');",
"assert(testEqual(\"12\") === \"Equal\", 'message: testEqual(\"12\")
should return \"Equal\"');",
- "assert(code.match(/val\\s*==[\\s'\"\\d]+/g).length > 0, 'message: You should use the ==
operator');"
+ "assert(code.match(/==/g) && !code.match(/===/g), 'message: You should use the ==
operator');"
],
"type": "waypoint",
"challengeType": 1,
@@ -3384,7 +3397,7 @@
"id": "5664820f61c48e80c9fa476c",
"title": "Golf Code",
"description": [
- "In the game of golf each hole has a par
for the average number of strokes
needed to sink the ball. Depending on how far above or below par
your strokes
are, there is a different nickname.",
+ "In the game of golf each hole has a par
meaning the average number of strokes
a golfer is expected to make in order to sink the ball in a hole to complete the play. Depending on how far above or below par
your strokes
are, there is a different nickname.",
"Your function will be passed par
and strokes
arguments. Return the correct string according to this table which lists the strokes in order of priority; top (highest) to bottom (lowest):",
"Strokes | Return |
---|
1 | \"Hole-in-one!\" |
<= par - 2 | \"Eagle\" |
par - 1 | \"Birdie\" |
par | \"Par\" |
par + 1 | \"Bogey\" |
par + 2 | \"Double Bogey\" |
>= par + 3 | \"Go Home!\" |
",
"par
and strokes
will always be numeric and positive."
@@ -4317,15 +4330,22 @@
},
{
"id": "56533eb9ac21ba0edf2244cb",
- "title": "Introducing JavaScript Object Notation (JSON)",
+ "title": "Manipulating Complex Objects",
"description": [
- "JavaScript Object Notation or JSON
uses the format of JavaScript Objects to store data. JSON is flexible because it allows for Data Structures with arbitrary combinations of strings, numbers, booleans, arrays, and objects.",
+ "JavaScript objects are flexible because they allow for Data Structures with arbitrary combinations of strings, numbers, booleans, arrays, functions, and objects.",
+ "Here is an example of a complex data structure:",
+ "var ourMusic = [
{
\"artist\": \"Daft Punk\",
\"title\": \"Homework\",
\"release_year\": 1997,
\"formats\": [
\"CD\",
\"Cassette\",
\"LP\" ],
\"gold\": true
}
];
",
+ "This is an array of objects and the object has various pieces of metadata about an album. It also has a nested formats
array. Additional album records could be added to the top level array.",
+ "Note
You will need a comma in between objects with more than one object in the array.",
+ "JavaScript Object Notation or JSON
is a data interchange format used to store data (source: json.org).",
+ "A property is the part of an object that associates a key (either a String value or a Symbol value) and a value (source: ecma-international.org/ecma-262/6.0/#sec-property). So, a property consists of a key - value pair. (source: spacetelescope.github.io/understanding-json-schema/reference/object.html#properties). Property keys (also known as names) should be in quotation marks.",
+ "Like JavaScript Objects, JSON is flexible because it is heterogeneous, meaning it permits Data Structures with arbitrary combinations of strings, booleans, numbers, arrays, and objects.",
"Here is an example of a JSON object:",
"var ourMusic = [
{
\"artist\": \"Daft Punk\",
\"title\": \"Homework\",
\"release_year\": 1997,
\"formats\": [
\"CD\",
\"Cassette\",
\"LP\" ],
\"gold\": true
}
];
",
"This is an array of objects and the object has various pieces of metadata about an album. It also has a nested formats
array. Additional album records could be added to the top level array.",
- "Note
You will need a comma in between objects in JSON objects with more than one object in the array.",
+ "Note
You will need to place a comma in between objects in JSON unless there is only one object in the array or containing object.",
"Instructions
",
- "Add a new album to the myMusic
JSON object. Add artist
and title
strings, release_year
number, and a formats
array of strings."
+ "Add a new album to the myMusic
object. Add artist
and title
strings, release_year
number, and a formats
array of strings."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [
@@ -4363,26 +4383,26 @@
],
"type": "waypoint",
"challengeType": 1,
- "titleEs": "Introducción a la notación de objetos de JavaScript (JSON - JavaScript Object Notation)",
+ "titleEs": "Manipula objetos complicados",
"descriptionEs": [
- "La notación de objetos de JavaScript o JSON
usa el formato de objetos de JavaScript para almacenar datos. JSON es flexible porque permite Estructuras de Datos con combinaciones arbitrarias de cadenas, números, booleanos, vectores y objetos.",
- "Aquí está un ejemplo de un objeto JSON:",
+ "Los objetos Javascript son flexibles porque permiten Estructuras de Datos con combinaciones arbitrarias de cadenas, números, booleanos, vectores, funciones, y objetos.",
+ "Aquí está un ejemplo de un objeto complicado:",
"var nuestraMusica = [
{
\"artista\": \"Daft Punk\",
\"titulo\": \"Homework\",
\"año_publicacion\": 1997,
\"formatos\": [
\"CD\",
\"Cassette\",
\"LP\" ],
\"oro\": true
}
];
",
"Este es un vector de objetos con diversos metadatos acerca de un álbum musical. Además tiene anidado un vector formatos
. En el vector de nivel superior, pueden añadirse otros registros del álbum.",
- "Nota
En objetos JSON que tengan más de un objeto en el vector, necesitarás separar un objeto de otro mediante comas.",
+ "Nota
En vectores que tengan más de un objeto, necesitarás separar un objeto de otro mediante comas.",
"Instrucciones
",
- "Agrega un nuevo álbum al objeto JSON myMusic
. Agrega las cadenas artist
y title
, el número release_year
y un vector de cadenas formats
."
+ "Agrega un nuevo álbum al objeto myMusic
. Agrega las cadenas artist
y title
, el número release_year
y un vector de cadenas formats
."
]
},
{
"id": "56533eb9ac21ba0edf2244cc",
- "title": "Accessing Nested Objects in JSON",
+ "title": "Accessing Nested Objects",
"description": [
- "The properties and sub-properties of JSON objects can be accessed by chaining together the dot or bracket notation.",
- "Here is a nested JSON Object:",
+ "The sub-properties of objects can be accessed by chaining together the dot or bracket notation.",
+ "Here is a nested object:",
"var ourStorage = {
\"desk\": {
\"drawer\": \"stapler\"
},
\"cabinet\": {
\"top drawer\": {
\"folder1\": \"a file\",
\"folder2\": \"secrets\"
},
\"bottom drawer\": \"soda\"
}
}
ourStorage.cabinet[\"top drawer\"].folder2; // \"secrets\"
ourStorage.desk.drawer; // \"stapler\"
",
"Instructions
",
- "Access the myStorage
JSON object to retrieve the contents of the glove box
. Use bracket notation for properties with a space in their name."
+ "Access the myStorage
object to retrieve the contents of the glove box
. Use bracket notation for properties with a space in their name."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [
@@ -4421,20 +4441,20 @@
],
"type": "waypoint",
"challengeType": 1,
- "titleEs": "Acceder a objetos anidados en JSON",
+ "titleEs": "Acceder a objetos anidados",
"descriptionEs": [
- "Las propiedades y sub-propiedades de los objetos JSON pueden ser accesadas mediante encadenamiento de la notación punto o corchete.",
- "Aquí está un objeto JSON anidado:",
+ "Las sub-propiedades de los objetos pueden ser accesadas mediante encadenamiento de la notación punto o corchete.",
+ "Aquí está un objeto anidado:",
"var nuestroAlmacen = {
\"escritorio\": {
\"cajon\": \"grapadora\"
},
\"armario\": {
\"cajón superior\": {
\"legajador1\": \"un archivo\",
\"legajador2\": \"secretos\"
},
\"cajón inferior\": \"gaseosa\"
}
}
nuestroAlmacen.armario[\"cajón superior\"].legajador2; // \"secretos\"
nuestroAlmacen.escritorio.cajon; // \"grapadora\"
",
"Instrucciones
",
- "Accede al objeto JSON myStorage
para recuperar el contenido de glove box
. Usa notación corchete para las propiedades con un espacio en su nombre."
+ "Accede al objeto myStorage
para recuperar el contenido de glove box
. Usa notación corchete para las propiedades con un espacio en su nombre."
]
},
{
"id": "56533eb9ac21ba0edf2244cd",
- "title": "Accessing Nested Arrays in JSON",
+ "title": "Accessing Nested Arrays",
"description": [
- "As we have seen in earlier examples, JSON objects can contain both nested objects and nested arrays. Similar to accessing nested objects, Array bracket notation can be chained to access nested arrays.",
+ "As we have seen in earlier examples, objects can contain both nested objects and nested arrays. Similar to accessing nested objects, Array bracket notation can be chained to access nested arrays.",
"Here is an example of how to access a nested array:",
"var ourPets = [
{
animalType: \"cat\",
names: [
\"Meowzer\",
\"Fluffy\",
\"Kit-Cat\"
]
},
{
animalType: \"dog\",
names: [
\"Spot\",
\"Bowser\",
\"Frankie\"
]
}
];
ourPets[0].names[1]; // \"Fluffy\"
ourPets[1].names[0]; // \"Spot\"
",
"Instructions
",
@@ -4484,9 +4504,9 @@
],
"type": "waypoint",
"challengeType": 1,
- "titleEs": "Acceder a vectores anidados en JSON",
+ "titleEs": "Acceder a vectores anidados",
"descriptionEs": [
- "Como hemos visto en ejemplos anteriores, los objetos JSON pueden contener objetos anidados y vectores anidados. De forma similar a acceder a objetos anidados, la notación corchete en vectores puede ser encadenada para acceder a vectores anidados.",
+ "Como hemos visto en ejemplos anteriores, los objetos pueden contener objetos anidados y vectores anidados. De forma similar a acceder a objetos anidados, la notación corchete en vectores puede ser encadenada para acceder a vectores anidados.",
"Aquí está un ejemplo de como acceder a un vector anidado:",
"var nuestrasMascotas = {
\"gatos\": [
\"Maullador\",
\"Blandito\",
\"Kit-Cat\"
],
\"perros\": [
\"Mancha\",
\"Bowser\",
\"Frankie\"
]
};
nuestrasMascotas.cats[1]; // \"Blandito\"
nuestrasMascotas.dogs[0]; // \"Mancha\"
",
"Instrucciones
",
@@ -4497,46 +4517,49 @@
"id": "56533eb9ac21ba0edf2244cf",
"title": "Record Collection",
"description": [
- "You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.",
+ "You are given an object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.",
+ "You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number (its key) and has several properties. Not all albums have complete information.",
"Write a function which takes an id
, a property (prop
), and a value
.",
"For the given id
in collection
:",
- "If value
is non-blank (value !== \"\"
) and prop
is not \"tracks\"
then update or set the value
for the prop
.",
- "If the prop
is \"tracks\"
and value
is non-blank, push the value
onto the end of the tracks
array.",
- "If \"tracks\"
is non-existent before you update it, create an empty array before pushing a track to it.",
+ "If prop
does not contain the key \"tracks\"
, then update or set the value
for that incomplete prop
.",
+ "If prop
does not contain the key \"tracks\"
before you update it, create an empty array before pushing a track to it.",
+ "If prop
does contain the key \"tracks\"
and its value
is non-blank, then push the value
onto the end of its existing tracks
array.",
"If value
is blank, delete that prop
.",
"Always return the entire collection object.",
- "Note
Don't forget to use bracket notation
when accessing object properties with variables."
+ "Hints
Use bracket notation
when accessing object properties with variables.",
+ "Push is an array method you can read about on Mozilla Developer Network.",
+ "You may refer back to Introducing JavaScript Object Notation (JSON) for a refresher."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [
"// Setup",
"var collection = {",
- " 2548: {",
- " album: \"Slippery When Wet\",",
- " artist: \"Bon Jovi\",",
+ " \"2548\": {",
+ " \"album\": \"Slippery When Wet\",",
+ " \"artist\": \"Bon Jovi\",",
" tracks: [ ",
" \"Let It Rock\", ",
" \"You Give Love a Bad Name\" ",
" ]",
" },",
- " 2468: {",
- " album: \"1999\",",
- " artist: \"Prince\",",
- " tracks: [ ",
+ " \"2468\": {",
+ " \"album\": \"1999\",",
+ " \"artist\": \"Prince\",",
+ " \"tracks\": [ ",
" \"1999\", ",
" \"Little Red Corvette\" ",
" ]",
" },",
- " 1245: {",
- " artist: \"Robert Palmer\",",
- " tracks: [ ]",
+ " \"1245\": {",
+ " \"artist\": \"Robert Palmer\",",
+ " \"tracks\": [ ]",
" },",
- " 5439: {",
- " album: \"ABBA Gold\"",
+ " \"5439\": {",
+ " \"album\": \"ABBA Gold\"",
" }",
"};",
"// Keep a copy of the collection for tests",
- "var collectionCopy = JSON.parse(JSON.stringify(collection));",
+ "var collectionCopy = JSON.parse(stringify(collection));",
"",
"// Only change code below this line",
"function updateRecords(id, prop, value) {",
@@ -4566,7 +4589,7 @@
"challengeType": 1,
"titleEs": "Colección de registros",
"descriptionEs": [
- "Se te da un objeto JSON que representa (una pequeña parte de) tu colección de grabaciones. Cada álbum es identificado por un número id único y tiene varias propiedades. No todos los álbumes tienen la información completa.",
+ "Se te da un objeto que representa (una pequeña parte de) tu colección de grabaciones. Cada álbum es identificado por un número id único y tiene varias propiedades. No todos los álbumes tienen la información completa.",
"Escribe una función que reciba un id
, una propiedad (prop
) y un valor (value
).",
"Para el id
dado, en la colección collection
:",
"Si el valor value
no está en blanco (value !== \"\"
) y prop
no es \"tracks\"
entonces actualiza o establece el valor de la propiedad prop
.",
diff --git a/seed/challenges/01-front-end-development-certification/html5-and-css.json b/seed/challenges/01-front-end-development-certification/html5-and-css.json
index b51b6a8d5c..44c4e70664 100644
--- a/seed/challenges/01-front-end-development-certification/html5-and-css.json
+++ b/seed/challenges/01-front-end-development-certification/html5-and-css.json
@@ -733,7 +733,8 @@
"assert($(\"p\").length > 1, 'message: You need 2 p
elements with Kitty Ipsum text.');",
"assert(code.match(/<\\/p>/g) && code.match(/<\\/p>/g).length === code.match(/p elements has a closing tag.');",
"assert.isTrue((/Purr\\s+jump\\s+eat/gi).test($(\"p\").text()), 'message: Your p
element should contain the first few words of the provided additional kitty ipsum text
.');",
- "assert($(\"p:not([class])\").length === 1, 'message: Do not add a class attribute to the second p
element.');",
+ "assert($(\"p:eq(0)\").attr(\"class\") === \"red-text\", 'message: The first p
element should have the class red-text
.');",
+ "assert($(\"p:eq(1)\").attr(\"class\") === undefined, 'message: Do not add a class attribute to the second p
element.');",
"assert(parseInt($(\"p:not([class])\").css(\"font-size\"), 10) > 15, 'message: Between the style
tags, give the p
elements font-size
of 16px
. Browser and Text zoom should be at 100%.');"
],
"type": "waypoint",
@@ -1415,7 +1416,7 @@
],
"tests": [
"assert((/cat photos/gi).test($(\"a\").text()), 'message: Your a
element should have the anchor text
of \"cat photos\".');",
- "assert(/http:\\/\\/freecatphotoapp\\.com/gi.test($(\"a\").attr(\"href\")), 'message: You need an a
element that links to http://freecatphotoapp.com
');",
+ "assert(/http:\\/\\/freecatphotoapp\\.com/gi.test($(\"a\").attr(\"href\")), 'message: You need an a
element that links to http://freecatphotoapp.com
');",
"assert(code.match(/<\\/a>/g) && code.match(/<\\/a>/g).length === code.match(/a element has a closing tag.');"
],
"type": "waypoint",
@@ -1510,7 +1511,7 @@
"assert($(\"a\").text().match(/cat\\sphotos/gi), 'message: Your a
element should have the anchor text of \"cat photos\"');",
"assert($(\"p\") && $(\"p\").length > 2, 'message: Create a new p
element around your a
element.');",
"assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\"), 'message: Your a
element should be nested within your new p
element.');",
- "assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().text().match(/^\\s*View\\smore\\s/gi), 'message: Your p
element should have the text \"View more \" (with a space after it).');",
+ "assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().text().match(/View\\smore\\s/gi), 'message: Your p
element should have the text \"View more \" (with a space after it).');",
"assert(!$(\"a\").text().match(/View\\smore/gi), 'message: Your a
element should not have the text \"View more\".');",
"assert(code.match(/<\\/p>/g) && code.match(//g).length === code.match(/
p elements has a closing tag.');",
"assert(code.match(/<\\/a>/g) && code.match(//g).length === code.match(/a elements has a closing tag.');"
diff --git a/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json b/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json
index 020a54924b..c5adcaedcc 100644
--- a/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json
+++ b/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json
@@ -33,7 +33,7 @@
"MDNlinks": [
"Math.max()",
"Math.min()",
- "Array.reduce()"
+ "Array.prototype.reduce()"
],
"isRequired": true,
"challengeType": 5,
@@ -82,10 +82,10 @@
"type": "bonfire",
"MDNlinks": [
"Comparison Operators",
- "Array.slice()",
- "Array.filter()",
- "Array.indexOf()",
- "Array.concat()"
+ "Array.prototype.slice()",
+ "Array.prototype.filter()",
+ "Array.prototype.indexOf()",
+ "Array.prototype.concat()"
],
"isRequired": true,
"challengeType": 5,
@@ -148,9 +148,9 @@
"type": "bonfire",
"MDNlinks": [
"Roman Numerals",
- "Array.splice()",
- "Array.indexOf()",
- "Array.join()"
+ "Array.prototype.splice()",
+ "Array.prototype.indexOf()",
+ "Array.prototype.join()"
],
"isRequired": true,
"challengeType": 5,
@@ -200,7 +200,7 @@
"type": "bonfire",
"MDNlinks": [
"Global Object",
- "Object.hasOwnProperty()",
+ "Object.prototype.hasOwnProperty()",
"Object.keys()"
],
"isRequired": true,
@@ -248,9 +248,9 @@
],
"type": "bonfire",
"MDNlinks": [
- "Array.splice()",
- "String.replace()",
- "Array.join()"
+ "Array.prototype.splice()",
+ "String.prototype.replace()",
+ "Array.prototype.join()"
],
"isRequired": true,
"challengeType": 5,
@@ -301,11 +301,11 @@
],
"type": "bonfire",
"MDNlinks": [
- "Array.indexOf()",
- "Array.push()",
- "Array.join()",
- "String.substr()",
- "String.split()"
+ "Array.prototype.indexOf()",
+ "Array.prototype.push()",
+ "Array.prototype.join()",
+ "String.prototype.substr()",
+ "String.prototype.split()"
],
"isRequired": true,
"challengeType": 5,
@@ -352,8 +352,8 @@
],
"type": "bonfire",
"MDNlinks": [
- "Array.push()",
- "String.split()"
+ "Array.prototype.push()",
+ "String.prototype.split()"
],
"isRequired": true,
"challengeType": 5,
@@ -499,7 +499,7 @@
"type": "bonfire",
"MDNlinks": [
"Arguments object",
- "Array.reduce()"
+ "Array.prototype.reduce()"
],
"isRequired": true,
"challengeType": 5,
@@ -551,7 +551,7 @@
"MDNlinks": [
"RegExp",
"HTML Entities",
- "String.replace()"
+ "String.prototype.replace()"
],
"isRequired": true,
"challengeType": 5,
@@ -595,7 +595,7 @@
"type": "bonfire",
"MDNlinks": [
"RegExp",
- "String.replace()"
+ "String.prototype.replace()"
],
"isRequired": true,
"challengeType": 5,
@@ -685,7 +685,7 @@
"type": "bonfire",
"MDNlinks": [
"For Loops",
- "Array.push()"
+ "Array.prototype.push()"
],
"isRequired": true,
"challengeType": 5,
@@ -775,7 +775,7 @@
],
"type": "bonfire",
"MDNlinks": [
- "Array.filter()"
+ "Array.prototype.filter()"
],
"isRequired": true,
"challengeType": 5,
@@ -821,8 +821,8 @@
"type": "bonfire",
"MDNlinks": [
"Arguments object",
- "Array.shift()",
- "Array.slice()"
+ "Array.prototype.shift()",
+ "Array.prototype.slice()"
],
"isRequired": true,
"challengeType": 5,
diff --git a/seed/challenges/01-front-end-development-certification/jquery.json b/seed/challenges/01-front-end-development-certification/jquery.json
index a3a15489c5..db5730aced 100644
--- a/seed/challenges/01-front-end-development-certification/jquery.json
+++ b/seed/challenges/01-front-end-development-certification/jquery.json
@@ -45,8 +45,8 @@
],
"tests": [
"assert(code.match(/<\\/script\\s*>/g) && code.match(/