Merge branch 'staging' of github.com:FreeCodeCamp/freecodecamp into staging
This commit is contained in:
@ -277,9 +277,9 @@
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');",
|
||||
"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'one month apart can be inferred it is the next year');",
|
||||
"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');",
|
||||
"assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);",
|
||||
"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th, 2016']);",
|
||||
"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'one month apart can be inferred it is the same year');",
|
||||
"assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');",
|
||||
"assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023']);"
|
||||
],
|
||||
|
@ -121,23 +121,26 @@
|
||||
"For example, if we created a variable <code>var firstName = \"Julie\"</code>, we could find out how long the string \"Julie\" is by using the <code>firstName.length</code> property."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(typeof(lastNameLength) != 'undefined' && typeof(lastNameLength) == 'number' && lastNameLength == 4){return(true);}else{return(false);}})(), 'lastNameLength should be equal to four')"
|
||||
"assert((function(){if(typeof(lastNameLength) != 'undefined' && typeof(lastNameLength) == 'number' && lastNameLength == 4){return(true);}else{return(false);}})(), 'lastNameLength should be equal to four')",
|
||||
"assert((function(){if(editor.getValue().match(/\\.length/gi).length >= 2 && editor.getValue().match(/var lastNameLength \\= 0;/gi).length >= 1){return(true);}else{return(false);}})(), 'You should be getting the length of <code>lastName</code> by using .length like this <code>lastName.length</code>');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstNameLength = 0;",
|
||||
"var lastNameLength = 0;",
|
||||
"var firstName = \"Madeline\";",
|
||||
"",
|
||||
"var firstNameLength = firstName.length;",
|
||||
"firstNameLength = firstName.length;",
|
||||
"",
|
||||
"var lastName = \"Chen\";",
|
||||
"",
|
||||
"var lastNameLength = lastName;",
|
||||
"lastNameLength = lastName;",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"// You can ignore this.",
|
||||
"// We use this to show you the value of your variable in your output box.",
|
||||
"// We'll learn about functions soon.",
|
||||
"if(typeof(lastNameLength) != 'undefined')(function(v){return(v);})(lastNameLength);}"
|
||||
"if(typeof(lastNameLength) != 'undefined'){(function(v){return(v);})(lastNameLength);}"
|
||||
],
|
||||
"challengeType": 1
|
||||
},
|
||||
@ -154,16 +157,19 @@
|
||||
"Try looking at the <code>firstLetterOfFirstName</code> variable declaration if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(typeof(firstLetterOfLastName) != 'undefined' && typeof(firstLetterOfLastName) == 'string' && firstLetterOfLastName == 'C'){return(true);}else{return(false);}})(), 'The first letter of firstLetterOfLastName should be a C');"
|
||||
"assert((function(){if(typeof(firstLetterOfLastName) != 'undefined' && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) == 'string' && firstLetterOfLastName == 'C'){return(true);}else{return(false);}})(), 'The first letter of firstLetterOfLastName should be a C');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstLetterOfLastName = \"\"",
|
||||
"var firstLetterOfLastName = \"\"",
|
||||
"",
|
||||
"var firstName = \"Madeline\";",
|
||||
"",
|
||||
"var firstLetterOfFirstName = firstName[0];",
|
||||
"firstLetterOfFirstName = firstName[0];",
|
||||
"",
|
||||
"var lastName = \"Chen\";",
|
||||
"",
|
||||
"var firstLetterOfLastName = lastName;",
|
||||
"firstLetterOfLastName = lastName;",
|
||||
"",
|
||||
"",
|
||||
"// You can ignore this.",
|
||||
@ -562,7 +568,7 @@
|
||||
"difficulty": "9.9818",
|
||||
"description": [
|
||||
"",
|
||||
"Now that we've learn how to <code> pop </code> things from the end of the array, we need to learn how to <code> push </code> stuff back to the end",
|
||||
"Now that we've learned how to <code> pop </code> things from the end of the array, we need to learn how to <code> push </code> stuff back to the end",
|
||||
"Let's take the code we had last time and <code> push </code> this value to the end: <code> ['dog', 3] </code>"
|
||||
],
|
||||
"tests": [
|
||||
@ -644,7 +650,7 @@
|
||||
"Let's try creating and calling a function now called <code>myFunction</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert((function(){if(typeof(f) !== 'undefined' && typeof(f) === 'number' && f === a + b && editor.getValue().match(RegExp('return\\\\(a\\\\+b\\\\)', 'g')).length >= 1){return(true);}else{return(false);}})(), 'Your function should return the value of a + b');"
|
||||
"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');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var a = 4;",
|
||||
@ -794,7 +800,7 @@
|
||||
"description":[
|
||||
"",
|
||||
"Loops are a critical part of any program! The next few challenges",
|
||||
"first we will be taking a look at the for loop",
|
||||
"first we will be taking a look at the while loop",
|
||||
"<code>",
|
||||
"var ourArray = [];",
|
||||
"var i = 0;",
|
||||
|
@ -797,8 +797,8 @@
|
||||
"Delete the \".red-text\", \"p\", and \".smaller-image\" CSS declarations from your <code>style</code> element so that the only declarations left in your <code>style</code> element are \"h2\" and \"thick-green-border\". Then Delete the <code>p</code> element that contains a dead link. Then remove the \"red-text\" class from your <code>h2</code> element and replace it with the \"text-primary\" Bootstrap class. Finally, remove the \"smaller-image\" class from your first <code>img</code> element and replace it with the <code>img-responsive</code> class."
|
||||
],
|
||||
"tests": [
|
||||
"assert(!$('h2').hasClass('red-text'), 'You h2 element should no longer have the class \"red-text\".')",
|
||||
"assert($('h2').hasClass('text-primary'), 'You h2 element should now have the class \"text-primary\".')",
|
||||
"assert(!$('h2').hasClass('red-text'), 'Your h2 element should no longer have the class \"red-text\".')",
|
||||
"assert($('h2').hasClass('text-primary'), 'Your h2 element should now have the class \"text-primary\".')",
|
||||
"assert(!$('p').css('font-family').match(/monospace/i), 'Your paragraph elements should no longer use the font \"Monospace\".')",
|
||||
"assert(!$('img').hasClass('smaller-image'), 'Remove the \"smaller-image\" class from your top image.')",
|
||||
"assert($('.img-responsive').length > 1, 'Add the \"img-responsive\" class to your top image.')"
|
||||
@ -1874,7 +1874,7 @@
|
||||
},
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908854",
|
||||
"name": "Waypoint: Label Boostrap Wells",
|
||||
"name": "Waypoint: Label Bootstrap Wells",
|
||||
"dashedName": "waypoint-label-bootstrap-wells",
|
||||
"difficulty": 2.26,
|
||||
"description": [
|
||||
@ -1883,9 +1883,9 @@
|
||||
"Above your right-well, inside its \"col-xs-6\" <code>div</code> element, add a <code>h4</code> element with the text \"#right-well\"."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('.col-xs-12').children('h4') && $('.col-xs-12').children('h4').length > 1, 'Add an <code>h4</code> element to each of your <code><div class='col-xs-6'></code> elements.')",
|
||||
"assert(new RegExp('#left-well','gi').test($('h4').text()), 'One <code>h4</code> element should have the text \"#left-well\".')",
|
||||
"assert(new RegExp('#right-well','gi').test($('h4').text()), 'One <code>h4</code> element should have the text \"#right-well\".')"
|
||||
"assert($('.col-xs-12').children('h4') && $('.col-xs-12').children('h4').length > 1, 'Add an <code>h4</code> element to each of your <code><div class=\\'col-xs-6\\'></code> elements.');",
|
||||
"assert(new RegExp('#left-well','gi').test($('h4').text()), 'One <code>h4</code> element should have the text \"#left-well\".');",
|
||||
"assert(new RegExp('#right-well','gi').test($('h4').text()), 'One <code>h4</code> element should have the text \"#right-well\".');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<div class='container-fluid'>",
|
||||
@ -1930,12 +1930,12 @@
|
||||
"Give each of your buttons a unique id like, starting with \"target1\" and ending with \"target6\"."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('#target1') && $('#target1').length > 0, 'One <code>button</code> element should have the id \"#target1\".')",
|
||||
"assert($('#target2') && $('#target2').length > 0, 'One <code>button</code> element should have the id \"#target2\".')",
|
||||
"assert($('#target3') && $('#target3').length > 0, 'One <code>button</code> element should have the id \"#target3\".')",
|
||||
"assert($('#target4') && $('#target4').length > 0, 'One <code>button</code> element should have the id \"#target4\".')",
|
||||
"assert($('#target5') && $('#target5').length > 0, 'One <code>button</code> element should have the id \"#target5\".')",
|
||||
"assert($('#target6') && $('#target6').length > 0, 'One <code>button</code> element should have the id \"#target6\".')"
|
||||
"assert($('#target1') && $('#target1').length > 0, 'One <code>button</code> element should have the id \"target1\".')",
|
||||
"assert($('#target2') && $('#target2').length > 0, 'One <code>button</code> element should have the id \"target2\".')",
|
||||
"assert($('#target3') && $('#target3').length > 0, 'One <code>button</code> element should have the id \"target3\".')",
|
||||
"assert($('#target4') && $('#target4').length > 0, 'One <code>button</code> element should have the id \"target4\".')",
|
||||
"assert($('#target5') && $('#target5').length > 0, 'One <code>button</code> element should have the id \"target5\".')",
|
||||
"assert($('#target6') && $('#target6').length > 0, 'One <code>button</code> element should have the id \"target6\".')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<div class='container-fluid'>",
|
||||
|
@ -160,8 +160,8 @@
|
||||
"Make all the <code>button</code> element with the id \"target3\" fadeOut. <code>$('#target3').addClass('animated fadeOut')</code>."
|
||||
],
|
||||
"tests": [
|
||||
"$('#target3').hasClass('animated') && $('#target3').hasClass('fadeOut'), 'Select the <code>button</code>element with the <code>id</code> of \"target3\" and use the jQuery <code>addClass()</code> function to give it the classes of \"animated\" and \"fadeOut\".')",
|
||||
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
|
||||
"assert($('#target3').hasClass('animated') && $('#target3').hasClass('fadeOut'), 'Select the <code>button</code>element with the <code>id</code> of \"target3\" and use the jQuery <code>addClass()</code> function to give it the classes of \"animated\" and \"fadeOut\".');",
|
||||
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
|
Reference in New Issue
Block a user