Merge branch 'staging' of github.com:FreeCodeCamp/freecodecamp into staging

This commit is contained in:
Quincy Larson
2015-08-24 17:54:00 -07:00
5 changed files with 16 additions and 15 deletions

View File

@@ -13,7 +13,8 @@
"<code>// This is a comment.</code>",
"The slash-star-star-slash comment will comment out everything between the <code>/*</code> and the <code>*/</code> characters:",
"<code>/* This is also a comment */</code>",
"Try creating one of each."
"Try creating one of each.",
"And one more thing you need to notice. Starting at this waypoint in JavaScript related challenges (except AngularJS, all Ziplines, Git, Node.js and Express.js, MongoDB and Full Stack JavaScript Projects) you can see contents of <code>assert()</code> functions (in some challenges <code>except()</code>, <code>assert.equal()</code> and so on) which are used to test your code. It's part of these challenges that you are able to see the tests that are running against your code."
],
"tests":[
"assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a <code>\\/\\/</code> style comment that contains at least five letters');",
@@ -606,7 +607,7 @@
"Take the myArray array and <code>shift()</code> the first value off of it."
],
"tests": [
"assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return(true);}else{return(false);}})(myArray), 'myArray should only have the first two values left([\"John\", 23])');",
"assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return(true);}else{return(false);}})(myArray), 'myArray should only have the last two values left([23, [\"dog\", 3]])');",
"assert((function(d){if(d === 'John' && typeof(myRemoved) === 'string'){return(true);}else{return(false);}})(myRemoved), 'myRemoved should contain \"John\"');"
],
"challengeSeed": [
@@ -670,8 +671,8 @@
"<code>function functionName (a, b) {</code>",
"<code>&thinsp;&thinsp;return(a + b);</code>",
"<code>}</code>",
"We can \"call\" our function like this: <code>functionName();</code>, and it will run and return it's <code>return</code> value to us.",
"Create and call a function called <code>myFunction</code>."
"We can \"call\" our function like this: <code>functionName();</code>, and it will run and return its <code>return</code> value to us.",
"Create and call a function called <code>myFunction</code> that returns the sum of a and b."
],
"tests":[
"assert((function(){if(typeof(f) !== \"undefined\" && typeof(f) === \"number\" && f === a + b && editor.getValue().match(/return/gi).length >= 1 && editor.getValue().match(/a/gi).length >= 1 && editor.getValue().match(/b/gi).length >= 1 && editor.getValue().match(/\\+/gi).length >= 1){return(true);}else{return(false);}})(), 'Your function should return the value of a + b');"
@@ -684,9 +685,9 @@
" return a - b;",
"};",
"",
"//Don't modify above this line",
"//Create a function called myFunction that returns the value of a plus b.",
" // Only change code below this line.",
"// Don't modify above this line",
"// Create a function called myFunction that returns the value of a plus b.",
"// Only change code below this line.",
"",
"",
"",
@@ -903,7 +904,7 @@
"tests":[
"assert(typeof(myFunction()) === \"number\", 'The result of myFunction should be a number');",
"assert(editor.getValue().match(/Math.random/g), 'You should be using Math.random to create a random number');",
"assert(!(''+myFunction()).match(/\\./g), 'You should have multiplied the result of Math.random by 10 to make it a number that\\'s greater then zero');",
"assert(!(''+myFunction()).match(/\\./g), 'You should have multiplied the result of Math.random by 10 to make it a number that\\'s greater than zero');",
"assert(editor.getValue().match(/Math.floor/g), 'You should use Math.floor to remove the decimal part of the number');"
],
"challengeSeed":[