fix(challenge-md): Fix quotes that failed in the transform

This commit is contained in:
Bouncey
2018-10-08 01:01:53 +01:00
committed by mrugesh mohapatra
parent 392b28fa55
commit a859035023
1333 changed files with 5710 additions and 5710 deletions

View File

@ -23,15 +23,15 @@ Change the <code>nonMutatingPush</code> function so it uses <code>concat</code>
```yml
tests:
- text: Your code should use the <code>concat</code> method.
testString: 'assert(code.match(/\.concat/g), ''Your code should use the <code>concat</code> method.'');'
testString: 'assert(code.match(/\.concat/g), "Your code should use the <code>concat</code> method.");'
- text: Your code should not use the <code>push</code> method.
testString: 'assert(!code.match(/\.push/g), ''Your code should not use the <code>push</code> method.'');'
testString: 'assert(!code.match(/\.push/g), "Your code should not use the <code>push</code> method.");'
- text: The <code>first</code> array should not change.
testString: 'assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), ''The <code>first</code> array should not change.'');'
testString: 'assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), "The <code>first</code> array should not change.");'
- text: The <code>second</code> array should not change.
testString: 'assert(JSON.stringify(second) === JSON.stringify([4, 5]), ''The <code>second</code> array should not change.'');'
testString: 'assert(JSON.stringify(second) === JSON.stringify([4, 5]), "The <code>second</code> array should not change.");'
- text: '<code>nonMutatingPush([1, 2, 3], [4, 5])</code> should return <code>[1, 2, 3, 4, 5]</code>.'
testString: 'assert(JSON.stringify(nonMutatingPush([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), ''<code>nonMutatingPush([1, 2, 3], [4, 5])</code> should return <code>[1, 2, 3, 4, 5]</code>.'');'
testString: 'assert(JSON.stringify(nonMutatingPush([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), "<code>nonMutatingPush([1, 2, 3], [4, 5])</code> should return <code>[1, 2, 3, 4, 5]</code>.");'
```
@ -46,7 +46,7 @@ tests:
function nonMutatingPush(original, newItem) {
// Add your code below this line
return original.push(newItem);
// Add your code above this line
}
var first = [1, 2, 3];

View File

@ -26,17 +26,17 @@ The output should not have any spaces
```yml
tests:
- text: The <code>globalTitle</code> variable should not change.
testString: 'assert(globalTitle === "Winter Is Coming", ''The <code>globalTitle</code> variable should not change.'');'
testString: 'assert(globalTitle === "Winter Is Coming", "The <code>globalTitle</code> variable should not change.");'
- text: Your code should not use the <code>replace</code> method for this challenge.
testString: 'assert(!code.match(/\.replace/g), ''Your code should not use the <code>replace</code> method for this challenge.'');'
testString: 'assert(!code.match(/\.replace/g), "Your code should not use the <code>replace</code> method for this challenge.");'
- text: <code>urlSlug("Winter Is Coming")</code> should return <code>"winter-is-coming"</code>.
testString: 'assert(urlSlug("Winter Is Coming") === "winter-is-coming", ''<code>urlSlug("Winter Is Coming")</code> should return <code>"winter-is-coming"</code>.'');'
testString: 'assert(urlSlug("Winter Is Coming") === "winter-is-coming", "<code>urlSlug("Winter Is Coming")</code> should return <code>"winter-is-coming"</code>.");'
- text: <code>urlSlug(" Winter Is &nbsp;Coming")</code> should return <code>"winter-is-coming"</code>.
testString: 'assert(urlSlug(" Winter Is Coming") === "winter-is-coming", ''<code>urlSlug(" Winter Is &nbsp;Coming")</code> should return <code>"winter-is-coming"</code>.'');'
testString: 'assert(urlSlug(" Winter Is Coming") === "winter-is-coming", "<code>urlSlug(" Winter Is &nbsp;Coming")</code> should return <code>"winter-is-coming"</code>.");'
- text: <code>urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone")</code> should return <code>"a-mind-needs-books-like-a-sword-needs-a-whetstone"</code>.
testString: 'assert(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") === "a-mind-needs-books-like-a-sword-needs-a-whetstone", ''<code>urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone")</code> should return <code>"a-mind-needs-books-like-a-sword-needs-a-whetstone"</code>.'');'
testString: 'assert(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") === "a-mind-needs-books-like-a-sword-needs-a-whetstone", "<code>urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone")</code> should return <code>"a-mind-needs-books-like-a-sword-needs-a-whetstone"</code>.");'
- text: <code>urlSlug("Hold The Door")</code> should return <code>"hold-the-door"</code>.
testString: 'assert(urlSlug("Hold The Door") === "hold-the-door", ''<code>urlSlug("Hold The Door")</code> should return <code>"hold-the-door"</code>.'');'
testString: 'assert(urlSlug("Hold The Door") === "hold-the-door", "<code>urlSlug("Hold The Door")</code> should return <code>"hold-the-door"</code>.");'
```
@ -53,8 +53,8 @@ var globalTitle = "Winter Is Coming";
// Add your code below this line
function urlSlug(title) {
}
// Add your code above this line

View File

@ -25,9 +25,9 @@ Fill in the code for the function <code>incrementer</code> so it returns the val
```yml
tests:
- text: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.
testString: 'assert(fixedValue === 4, ''Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.'');'
testString: 'assert(fixedValue === 4, "Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.");'
- text: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.
testString: 'assert(newValue === 5, ''Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.'');'
testString: 'assert(newValue === 5, "Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.");'
```
@ -44,8 +44,8 @@ var fixedValue = 4;
function incrementer () {
// Add your code below this line
// Add your code above this line
}

View File

@ -22,17 +22,17 @@ Use the <code>join</code> method (among others) inside the <code>sentensify</cod
```yml
tests:
- text: Your code should use the <code>join</code> method.
testString: 'assert(code.match(/\.join/g), ''Your code should use the <code>join</code> method.'');'
testString: 'assert(code.match(/\.join/g), "Your code should use the <code>join</code> method.");'
- text: Your code should not use the <code>replace</code> method.
testString: 'assert(!code.match(/\.replace/g), ''Your code should not use the <code>replace</code> method.'');'
testString: 'assert(!code.match(/\.replace/g), "Your code should not use the <code>replace</code> method.");'
- text: <code>sentensify("May-the-force-be-with-you")</code> should return a string.
testString: 'assert(typeof sentensify("May-the-force-be-with-you") === "string", ''<code>sentensify("May-the-force-be-with-you")</code> should return a string.'');'
testString: 'assert(typeof sentensify("May-the-force-be-with-you") === "string", "<code>sentensify("May-the-force-be-with-you")</code> should return a string.");'
- text: <code>sentensify("May-the-force-be-with-you")</code> should return <code>"May the force be with you"</code>.
testString: 'assert(sentensify("May-the-force-be-with-you") === "May the force be with you", ''<code>sentensify("May-the-force-be-with-you")</code> should return <code>"May the force be with you"</code>.'');'
testString: 'assert(sentensify("May-the-force-be-with-you") === "May the force be with you", "<code>sentensify("May-the-force-be-with-you")</code> should return <code>"May the force be with you"</code>.");'
- text: <code>sentensify("The.force.is.strong.with.this.one")</code> should return <code>"The force is strong with this one"</code>.
testString: 'assert(sentensify("The.force.is.strong.with.this.one") === "The force is strong with this one", ''<code>sentensify("The.force.is.strong.with.this.one")</code> should return <code>"The force is strong with this one"</code>.'');'
testString: 'assert(sentensify("The.force.is.strong.with.this.one") === "The force is strong with this one", "<code>sentensify("The.force.is.strong.with.this.one")</code> should return <code>"The force is strong with this one"</code>.");'
- text: '<code>sentensify("There,has,been,an,awakening")</code> should return <code>"There has been an awakening"</code>.'
testString: 'assert(sentensify("There,has,been,an,awakening") === "There has been an awakening", ''<code>sentensify("There,has,been,an,awakening")</code> should return <code>"There has been an awakening"</code>.'');'
testString: 'assert(sentensify("There,has,been,an,awakening") === "There has been an awakening", "<code>sentensify("There,has,been,an,awakening")</code> should return <code>"There has been an awakening"</code>.");'
```
@ -46,8 +46,8 @@ tests:
```js
function sentensify(str) {
// Add your code below this line
// Add your code above this line
}
sentensify("May-the-force-be-with-you");

View File

@ -21,13 +21,13 @@ Use the <code>concat</code> method in the <code>nonMutatingConcat</code> functio
```yml
tests:
- text: Your code should use the <code>concat</code> method.
testString: 'assert(code.match(/\.concat/g), ''Your code should use the <code>concat</code> method.'');'
testString: 'assert(code.match(/\.concat/g), "Your code should use the <code>concat</code> method.");'
- text: The <code>first</code> array should not change.
testString: 'assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), ''The <code>first</code> array should not change.'');'
testString: 'assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), "The <code>first</code> array should not change.");'
- text: The <code>second</code> array should not change.
testString: 'assert(JSON.stringify(second) === JSON.stringify([4, 5]), ''The <code>second</code> array should not change.'');'
testString: 'assert(JSON.stringify(second) === JSON.stringify([4, 5]), "The <code>second</code> array should not change.");'
- text: '<code>nonMutatingConcat([1, 2, 3], [4, 5])</code> should return <code>[1, 2, 3, 4, 5]</code>.'
testString: 'assert(JSON.stringify(nonMutatingConcat([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), ''<code>nonMutatingConcat([1, 2, 3], [4, 5])</code> should return <code>[1, 2, 3, 4, 5]</code>.'');'
testString: 'assert(JSON.stringify(nonMutatingConcat([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), "<code>nonMutatingConcat([1, 2, 3], [4, 5])</code> should return <code>[1, 2, 3, 4, 5]</code>.");'
```
@ -41,8 +41,8 @@ tests:
```js
function nonMutatingConcat(original, attach) {
// Add your code below this line
// Add your code above this line
}
var first = [1, 2, 3];

View File

@ -23,9 +23,9 @@ Write your own <code>Array.prototype.myMap()</code>, which should behave exactly
```yml
tests:
- text: '<code>new_s</code> should equal <code>[46, 130, 196, 10]</code>.'
testString: 'assert(JSON.stringify(new_s) === JSON.stringify([46, 130, 196, 10]), ''<code>new_s</code> should equal <code>[46, 130, 196, 10]</code>.'');'
testString: 'assert(JSON.stringify(new_s) === JSON.stringify([46, 130, 196, 10]), "<code>new_s</code> should equal <code>[46, 130, 196, 10]</code>.");'
- text: Your code should not use the <code>map</code> method.
testString: 'assert(!code.match(/\.map/g), ''Your code should not use the <code>map</code> method.'');'
testString: 'assert(!code.match(/\.map/g), "Your code should not use the <code>map</code> method.");'
```
@ -43,7 +43,7 @@ var s = [23, 65, 98, 5];
Array.prototype.myMap = function(callback){
var newArray = [];
// Add your code below this line
// Add your code above this line
return newArray;

View File

@ -21,9 +21,9 @@ Write your own <code>Array.prototype.myFilter()</code>, which should behave exac
```yml
tests:
- text: '<code>new_s</code> should equal <code>[23, 65, 5]</code>.'
testString: 'assert(JSON.stringify(new_s) === JSON.stringify([23, 65, 5]), ''<code>new_s</code> should equal <code>[23, 65, 5]</code>.'');'
testString: 'assert(JSON.stringify(new_s) === JSON.stringify([23, 65, 5]), "<code>new_s</code> should equal <code>[23, 65, 5]</code>.");'
- text: Your code should not use the <code>filter</code> method.
testString: 'assert(!code.match(/\.filter/g), ''Your code should not use the <code>filter</code> method.'');'
testString: 'assert(!code.match(/\.filter/g), "Your code should not use the <code>filter</code> method.");'
```
@ -41,7 +41,7 @@ var s = [23, 65, 98, 5];
Array.prototype.myFilter = function(callback){
var newArray = [];
// Add your code below this line
// Add your code above this line
return newArray;

View File

@ -28,13 +28,13 @@ Fill in the body of the <code>add</code> function so it uses currying to add par
```yml
tests:
- text: <code>add(10)(20)(30)</code> should return <code>60</code>.
testString: 'assert(add(10)(20)(30) === 60, ''<code>add(10)(20)(30)</code> should return <code>60</code>.'');'
testString: 'assert(add(10)(20)(30) === 60, "<code>add(10)(20)(30)</code> should return <code>60</code>.");'
- text: <code>add(1)(2)(3)</code> should return <code>6</code>.
testString: 'assert(add(1)(2)(3) === 6, ''<code>add(1)(2)(3)</code> should return <code>6</code>.'');'
testString: 'assert(add(1)(2)(3) === 6, "<code>add(1)(2)(3)</code> should return <code>6</code>.");'
- text: <code>add(11)(22)(33)</code> should return <code>66</code>.
testString: 'assert(add(11)(22)(33) === 66, ''<code>add(11)(22)(33)</code> should return <code>66</code>.'');'
testString: 'assert(add(11)(22)(33) === 66, "<code>add(11)(22)(33)</code> should return <code>66</code>.");'
- text: Your code should include a final statement that returns <code>x + y + z</code>.
testString: 'assert(code.match(/[xyz]\s*?\+\s*?[xyz]\s*?\+\s*?[xyz]/g), ''Your code should include a final statement that returns <code>x + y + z</code>.'');'
testString: 'assert(code.match(/[xyz]\s*?\+\s*?[xyz]\s*?\+\s*?[xyz]/g), "Your code should include a final statement that returns <code>x + y + z</code>.");'
```
@ -48,8 +48,8 @@ tests:
```js
function add(x) {
// Add your code below this line
// Add your code above this line
}
add(10)(20)(30);

View File

@ -26,9 +26,9 @@ In the code editor, the <code>prepareTea</code> and <code>getTea</code> function
```yml
tests:
- text: The <code>tea4TeamFCC</code> variable should hold 40 cups of tea for the team.
testString: 'assert(tea4TeamFCC.length === 40, ''The <code>tea4TeamFCC</code> variable should hold 40 cups of tea for the team.'');'
testString: 'assert(tea4TeamFCC.length === 40, "The <code>tea4TeamFCC</code> variable should hold 40 cups of tea for the team.");'
- text: The <code>tea4TeamFCC</code> variable should hold cups of green tea.
testString: 'assert(tea4TeamFCC[0] === ''greenTea'', ''The <code>tea4TeamFCC</code> variable should hold cups of green tea.'');'
testString: 'assert(tea4TeamFCC[0] === "greenTea", "The <code>tea4TeamFCC</code> variable should hold cups of green tea.");'
```
@ -53,7 +53,7 @@ const prepareTea = () => 'greenTea';
**/
const getTea = (numOfCups) => {
const teaCups = [];
for(let cups = 1; cups <= numOfCups; cups += 1) {
const teaCup = prepareTea();
teaCups.push(teaCup);

View File

@ -26,11 +26,11 @@ Write the <code>incrementer</code> function so it takes an argument, and then in
```yml
tests:
- text: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.
testString: 'assert(fixedValue === 4, ''Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.'');'
testString: 'assert(fixedValue === 4, "Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.");'
- text: Your <code>incrementer</code> function should take a parameter.
testString: 'assert(code.match(/function\s+?incrementer\s*?\(.+?\)/g), ''Your <code>incrementer</code> function should take a parameter.'');'
testString: 'assert(code.match(/function\s+?incrementer\s*?\(.+?\)/g), "Your <code>incrementer</code> function should take a parameter.");'
- text: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.
testString: 'assert(newValue === 5, ''Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.'');'
testString: 'assert(newValue === 5, "Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.");'
```
@ -47,8 +47,8 @@ var fixedValue = 4;
// Add your code below this line
function incrementer () {
// Add your code above this line
}

View File

@ -23,13 +23,13 @@ Refactor (rewrite) the code so the global array <code>bookList</code> is not cha
```yml
tests:
- text: '<code>bookList</code> should not change and still equal <code>["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]</code>.'
testString: 'assert(JSON.stringify(bookList) === JSON.stringify(["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]), ''<code>bookList</code> should not change and still equal <code>["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]</code>.'');'
testString: 'assert(JSON.stringify(bookList) === JSON.stringify(["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]), "<code>bookList</code> should not change and still equal <code>["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]</code>.");'
- text: '<code>newBookList</code> should equal <code>["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]</code>.'
testString: 'assert(JSON.stringify(newBookList) === JSON.stringify([''The Hound of the Baskervilles'', ''On The Electrodynamics of Moving Bodies'', ''Philosophiæ Naturalis Principia Mathematica'', ''Disquisitiones Arithmeticae'', ''A Brief History of Time'']), ''<code>newBookList</code> should equal <code>["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]</code>.'');'
testString: 'assert(JSON.stringify(newBookList) === JSON.stringify(["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]), "<code>newBookList</code> should equal <code>["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]</code>.");'
- text: '<code>newerBookList</code> should equal <code>["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]</code>.'
testString: 'assert(JSON.stringify(newerBookList) === JSON.stringify([''The Hound of the Baskervilles'', ''Philosophiæ Naturalis Principia Mathematica'', ''Disquisitiones Arithmeticae'']), ''<code>newerBookList</code> should equal <code>["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]</code>.'');'
testString: 'assert(JSON.stringify(newerBookList) === JSON.stringify(["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]), "<code>newerBookList</code> should equal <code>["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]</code>.");'
- text: '<code>newestBookList</code> should equal <code>["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]</code>.'
testString: 'assert(JSON.stringify(newestBookList) === JSON.stringify([''The Hound of the Baskervilles'', ''Philosophiæ Naturalis Principia Mathematica'', ''Disquisitiones Arithmeticae'', ''A Brief History of Time'']), ''<code>newestBookList</code> should equal <code>["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]</code>.'');'
testString: 'assert(JSON.stringify(newestBookList) === JSON.stringify(["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]), "<code>newestBookList</code> should equal <code>["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]</code>.");'
```
@ -49,9 +49,9 @@ var bookList = ["The Hound of the Baskervilles", "On The Electrodynamics of Movi
// Add your code below this line
function add (bookName) {
return bookList.push(bookName);
// Add your code above this line
}
@ -61,9 +61,9 @@ function add (bookName) {
// Add your code below this line
function remove (bookName) {
if (bookList.indexOf(bookName) >= 0) {
return bookList.splice(0, 1, bookName);
// Add your code above this line
}
}

View File

@ -23,13 +23,13 @@ Do not mutate the original array provided to the function.
```yml
tests:
- text: Your code should use the <code>slice</code> method.
testString: 'assert(code.match(/\.slice/g), ''Your code should use the <code>slice</code> method.'');'
testString: 'assert(code.match(/\.slice/g), "Your code should use the <code>slice</code> method.");'
- text: Your code should not use the <code>splice</code> method.
testString: 'assert(!code.match(/\.splice/g), ''Your code should not use the <code>splice</code> method.'');'
testString: 'assert(!code.match(/\.splice/g), "Your code should not use the <code>splice</code> method.");'
- text: The <code>inputCities</code> array should not change.
testString: 'assert(JSON.stringify(inputCities) === JSON.stringify(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]), ''The <code>inputCities</code> array should not change.'');'
testString: 'assert(JSON.stringify(inputCities) === JSON.stringify(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]), "The <code>inputCities</code> array should not change.");'
- text: '<code>nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])</code> should return <code>["Chicago", "Delhi", "Islamabad"]</code>.'
testString: 'assert(JSON.stringify(nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])) === JSON.stringify(["Chicago", "Delhi", "Islamabad"]), ''<code>nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])</code> should return <code>["Chicago", "Delhi", "Islamabad"]</code>.'');'
testString: 'assert(JSON.stringify(nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])) === JSON.stringify(["Chicago", "Delhi", "Islamabad"]), "<code>nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])</code> should return <code>["Chicago", "Delhi", "Islamabad"]</code>.");'
```
@ -44,7 +44,7 @@ tests:
function nonMutatingSplice(cities) {
// Add your code below this line
return cities.splice(3);
// Add your code above this line
}
var inputCities = ["Chicago", "Delhi", "Islamabad", "London", "Berlin"];

View File

@ -20,13 +20,13 @@ Use the <code>sort</code> method in the <code>nonMutatingSort</code> function to
```yml
tests:
- text: Your code should use the <code>sort</code> method.
testString: 'assert(code.match(/\.sort/g), ''Your code should use the <code>sort</code> method.'');'
testString: 'assert(code.match(/\.sort/g), "Your code should use the <code>sort</code> method.");'
- text: Your code should use the <code>concat</code> method.
testString: 'assert(code.match(/\.concat/g), ''Your code should use the <code>concat</code> method.'');'
testString: 'assert(code.match(/\.concat/g), "Your code should use the <code>concat</code> method.");'
- text: The <code>globalArray</code> variable should not change.
testString: 'assert(JSON.stringify(globalArray) === JSON.stringify([5, 6, 3, 2, 9]), ''The <code>globalArray</code> variable should not change.'');'
testString: 'assert(JSON.stringify(globalArray) === JSON.stringify([5, 6, 3, 2, 9]), "The <code>globalArray</code> variable should not change.");'
- text: '<code>nonMutatingSort(globalArray)</code> should return <code>[2, 3, 5, 6, 9]</code>.'
testString: 'assert(JSON.stringify(nonMutatingSort(globalArray)) === JSON.stringify([2, 3, 5, 6, 9]), ''<code>nonMutatingSort(globalArray)</code> should return <code>[2, 3, 5, 6, 9]</code>.'');'
testString: 'assert(JSON.stringify(nonMutatingSort(globalArray)) === JSON.stringify([2, 3, 5, 6, 9]), "<code>nonMutatingSort(globalArray)</code> should return <code>[2, 3, 5, 6, 9]</code>.");'
```
@ -41,8 +41,8 @@ tests:
var globalArray = [5, 6, 3, 2, 9];
function nonMutatingSort(arr) {
// Add your code below this line
// Add your code above this line
}
nonMutatingSort(globalArray);

View File

@ -22,15 +22,15 @@ Use the <code>slice</code> method in the <code>sliceArray</code> function to ret
```yml
tests:
- text: Your code should use the <code>slice</code> method.
testString: 'assert(code.match(/\.slice/g), ''Your code should use the <code>slice</code> method.'');'
testString: 'assert(code.match(/\.slice/g), "Your code should use the <code>slice</code> method.");'
- text: The <code>inputAnim</code> variable should not change.
testString: 'assert(JSON.stringify(inputAnim) === JSON.stringify(["Cat", "Dog", "Tiger", "Zebra", "Ant"]), ''The <code>inputAnim</code> variable should not change.'');'
testString: 'assert(JSON.stringify(inputAnim) === JSON.stringify(["Cat", "Dog", "Tiger", "Zebra", "Ant"]), "The <code>inputAnim</code> variable should not change.");'
- text: '<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)</code> should return <code>["Dog", "Tiger"]</code>.'
testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)) === JSON.stringify(["Dog", "Tiger"]), ''<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)</code> should return <code>["Dog", "Tiger"]</code>.'');'
testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)) === JSON.stringify(["Dog", "Tiger"]), "<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)</code> should return <code>["Dog", "Tiger"]</code>.");'
- text: '<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)</code> should return <code>["Cat"]</code>.'
testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)) === JSON.stringify(["Cat"]), ''<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)</code> should return <code>["Cat"]</code>.'');'
testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)) === JSON.stringify(["Cat"]), "<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)</code> should return <code>["Cat"]</code>.");'
- text: '<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)</code> should return <code>["Dog", "Tiger", "Zebra"]</code>.'
testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)) === JSON.stringify(["Dog", "Tiger", "Zebra"]), ''<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)</code> should return <code>["Dog", "Tiger", "Zebra"]</code>.'');'
testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)) === JSON.stringify(["Dog", "Tiger", "Zebra"]), "<code>sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)</code> should return <code>["Dog", "Tiger", "Zebra"]</code>.");'
```
@ -44,8 +44,8 @@ tests:
```js
function sliceArray(anim, beginSlice, endSlice) {
// Add your code below this line
// Add your code above this line
}
var inputAnim = ["Cat", "Dog", "Tiger", "Zebra", "Ant"];

View File

@ -23,13 +23,13 @@ Use the <code>sort</code> method in the <code>alphabeticalOrder</code> function
```yml
tests:
- text: Your code should use the <code>sort</code> method.
testString: 'assert(code.match(/\.sort/g), ''Your code should use the <code>sort</code> method.'');'
testString: 'assert(code.match(/\.sort/g), "Your code should use the <code>sort</code> method.");'
- text: '<code>alphabeticalOrder(["a", "d", "c", "a", "z", "g"])</code> should return <code>["a", "a", "c", "d", "g", "z"]</code>.'
testString: 'assert(JSON.stringify(alphabeticalOrder(["a", "d", "c", "a", "z", "g"])) === JSON.stringify(["a", "a", "c", "d", "g", "z"]), ''<code>alphabeticalOrder(["a", "d", "c", "a", "z", "g"])</code> should return <code>["a", "a", "c", "d", "g", "z"]</code>.'');'
testString: 'assert(JSON.stringify(alphabeticalOrder(["a", "d", "c", "a", "z", "g"])) === JSON.stringify(["a", "a", "c", "d", "g", "z"]), "<code>alphabeticalOrder(["a", "d", "c", "a", "z", "g"])</code> should return <code>["a", "a", "c", "d", "g", "z"]</code>.");'
- text: '<code>alphabeticalOrder(["x", "h", "a", "m", "n", "m"])</code> should return <code>["a", "h", "m", "m", "n", "x"]</code>.'
testString: 'assert(JSON.stringify(alphabeticalOrder(["x", "h", "a", "m", "n", "m"])) === JSON.stringify(["a", "h", "m", "m", "n", "x"]), ''<code>alphabeticalOrder(["x", "h", "a", "m", "n", "m"])</code> should return <code>["a", "h", "m", "m", "n", "x"]</code>.'');'
testString: 'assert(JSON.stringify(alphabeticalOrder(["x", "h", "a", "m", "n", "m"])) === JSON.stringify(["a", "h", "m", "m", "n", "x"]), "<code>alphabeticalOrder(["x", "h", "a", "m", "n", "m"])</code> should return <code>["a", "h", "m", "m", "n", "x"]</code>.");'
- text: '<code>alphabeticalOrder(["a", "a", "a", "a", "x", "t"])</code> should return <code>["a", "a", "a", "a", "t", "x"]</code>.'
testString: 'assert(JSON.stringify(alphabeticalOrder(["a", "a", "a", "a", "x", "t"])) === JSON.stringify(["a", "a", "a", "a", "t", "x"]), ''<code>alphabeticalOrder(["a", "a", "a", "a", "x", "t"])</code> should return <code>["a", "a", "a", "a", "t", "x"]</code>.'');'
testString: 'assert(JSON.stringify(alphabeticalOrder(["a", "a", "a", "a", "x", "t"])) === JSON.stringify(["a", "a", "a", "a", "t", "x"]), "<code>alphabeticalOrder(["a", "a", "a", "a", "x", "t"])</code> should return <code>["a", "a", "a", "a", "t", "x"]</code>.");'
```
@ -43,8 +43,8 @@ tests:
```js
function alphabeticalOrder(arr) {
// Add your code below this line
// Add your code above this line
}
alphabeticalOrder(["a", "d", "c", "a", "z", "g"]);

View File

@ -23,13 +23,13 @@ Use the <code>split</code> method inside the <code>splitify</code> function to s
```yml
tests:
- text: Your code should use the <code>split</code> method.
testString: 'assert(code.match(/\.split/g), ''Your code should use the <code>split</code> method.'');'
testString: 'assert(code.match(/\.split/g), "Your code should use the <code>split</code> method.");'
- text: '<code>splitify("Hello World,I-am code")</code> should return <code>["Hello", "World", "I", "am", "code"]</code>.'
testString: 'assert(JSON.stringify(splitify("Hello World,I-am code")) === JSON.stringify(["Hello", "World", "I", "am", "code"]), ''<code>splitify("Hello World,I-am code")</code> should return <code>["Hello", "World", "I", "am", "code"]</code>.'');'
testString: 'assert(JSON.stringify(splitify("Hello World,I-am code")) === JSON.stringify(["Hello", "World", "I", "am", "code"]), "<code>splitify("Hello World,I-am code")</code> should return <code>["Hello", "World", "I", "am", "code"]</code>.");'
- text: '<code>splitify("Earth-is-our home")</code> should return <code>["Earth", "is", "our", "home"]</code>.'
testString: 'assert(JSON.stringify(splitify("Earth-is-our home")) === JSON.stringify(["Earth", "is", "our", "home"]), ''<code>splitify("Earth-is-our home")</code> should return <code>["Earth", "is", "our", "home"]</code>.'');'
testString: 'assert(JSON.stringify(splitify("Earth-is-our home")) === JSON.stringify(["Earth", "is", "our", "home"]), "<code>splitify("Earth-is-our home")</code> should return <code>["Earth", "is", "our", "home"]</code>.");'
- text: '<code>splitify("This.is.a-sentence")</code> should return <code>["This", "is", "a", "sentence"]</code>.'
testString: 'assert(JSON.stringify(splitify("This.is.a-sentence")) === JSON.stringify(["This", "is", "a", "sentence"]), ''<code>splitify("This.is.a-sentence")</code> should return <code>["This", "is", "a", "sentence"]</code>.'');'
testString: 'assert(JSON.stringify(splitify("This.is.a-sentence")) === JSON.stringify(["This", "is", "a", "sentence"]), "<code>splitify("This.is.a-sentence")</code> should return <code>["This", "is", "a", "sentence"]</code>.");'
```
@ -43,8 +43,8 @@ tests:
```js
function splitify(str) {
// Add your code below this line
// Add your code above this line
}
splitify("Hello World,I-am code");

View File

@ -27,13 +27,13 @@ Note: The data (the number of cups of tea) is supplied as the last argument. We'
```yml
tests:
- text: The <code>tea4GreenTeamFCC</code> variable should hold 27 cups of green tea for the team.
testString: 'assert(tea4GreenTeamFCC.length === 27, ''The <code>tea4GreenTeamFCC</code> variable should hold 27 cups of green tea for the team.'');'
testString: 'assert(tea4GreenTeamFCC.length === 27, "The <code>tea4GreenTeamFCC</code> variable should hold 27 cups of green tea for the team.");'
- text: The <code>tea4GreenTeamFCC</code> variable should hold cups of green tea.
testString: 'assert(tea4GreenTeamFCC[0] === ''greenTea'', ''The <code>tea4GreenTeamFCC</code> variable should hold cups of green tea.'');'
testString: 'assert(tea4GreenTeamFCC[0] === "greenTea", "The <code>tea4GreenTeamFCC</code> variable should hold cups of green tea.");'
- text: The <code>tea4BlackTeamFCC</code> variable should hold 13 cups of black tea.
testString: 'assert(tea4BlackTeamFCC.length === 13, ''The <code>tea4BlackTeamFCC</code> variable should hold 13 cups of black tea.'');'
testString: 'assert(tea4BlackTeamFCC.length === 13, "The <code>tea4BlackTeamFCC</code> variable should hold 13 cups of black tea.");'
- text: The <code>tea4BlackTeamFCC</code> variable should hold cups of black tea.
testString: 'assert(tea4BlackTeamFCC[0] === ''blackTea'', ''The <code>tea4BlackTeamFCC</code> variable should hold cups of black tea.'');'
testString: 'assert(tea4BlackTeamFCC[0] === "blackTea", "The <code>tea4BlackTeamFCC</code> variable should hold cups of black tea.");'
```

View File

@ -30,7 +30,7 @@ Work through the code and see if you can figure out the problem, then advance to
```yml
tests:
- text: Move ahead to understand the error.
testString: 'assert(true, ''Move ahead to understand the error.'');'
testString: 'assert(true, "Move ahead to understand the error.");'
```
@ -64,7 +64,7 @@ Window.prototype.tabClose = function (index) {
var tabsBeforeIndex = this.tabs.splice(0, index); // get the tabs before the tab
var tabsAfterIndex = this.tabs.splice(index); // get the tabs after the tab
this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // join them together
this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // join them together
return this;
};

View File

@ -22,13 +22,13 @@ Use the <code>every</code> method inside the <code>checkPositive</code> function
```yml
tests:
- text: Your code should use the <code>every</code> method.
testString: 'assert(code.match(/\.every/g), ''Your code should use the <code>every</code> method.'');'
testString: 'assert(code.match(/\.every/g), "Your code should use the <code>every</code> method.");'
- text: '<code>checkPositive([1, 2, 3, -4, 5])</code> should return <code>false</code>.'
testString: 'assert(!checkPositive([1, 2, 3, -4, 5]), ''<code>checkPositive([1, 2, 3, -4, 5])</code> should return <code>false</code>.'');'
testString: 'assert(!checkPositive([1, 2, 3, -4, 5]), "<code>checkPositive([1, 2, 3, -4, 5])</code> should return <code>false</code>.");'
- text: '<code>checkPositive([1, 2, 3, 4, 5])</code> should return <code>true</code>.'
testString: 'assert(checkPositive([1, 2, 3, 4, 5]), ''<code>checkPositive([1, 2, 3, 4, 5])</code> should return <code>true</code>.'');'
testString: 'assert(checkPositive([1, 2, 3, 4, 5]), "<code>checkPositive([1, 2, 3, 4, 5])</code> should return <code>true</code>.");'
- text: '<code>checkPositive([1, -2, 3, -4, 5])</code> should return <code>false</code>.'
testString: 'assert(!checkPositive([1, -2, 3, -4, 5]), ''<code>checkPositive([1, -2, 3, -4, 5])</code> should return <code>false</code>.'');'
testString: 'assert(!checkPositive([1, -2, 3, -4, 5]), "<code>checkPositive([1, -2, 3, -4, 5])</code> should return <code>false</code>.");'
```
@ -42,8 +42,8 @@ tests:
```js
function checkPositive(arr) {
// Add your code below this line
// Add your code above this line
}
checkPositive([1, 2, 3, -4, 5]);

View File

@ -21,13 +21,13 @@ The variable <code>watchList</code> holds an array of objects with information o
```yml
tests:
- text: The <code>watchList</code> variable should not change.
testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", ''The <code>watchList</code> variable should not change.'');'
testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", "The <code>watchList</code> variable should not change.");'
- text: Your code should use the <code>filter</code> method.
testString: 'assert(code.match(/\.filter/g), ''Your code should use the <code>filter</code> method.'');'
testString: 'assert(code.match(/\.filter/g), "Your code should use the <code>filter</code> method.");'
- text: Your code should not use a <code>for</code> loop.
testString: 'assert(!code.match(/for\s*?\(.+?\)/g), ''Your code should not use a <code>for</code> loop.'');'
testString: 'assert(!code.match(/for\s*?\(.+?\)/g), "Your code should not use a <code>for</code> loop.");'
- text: '<code>filteredList</code> should equal <code>[{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}]</code>.'
testString: 'assert.deepEqual(filteredList, [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}], ''<code>filteredList</code> should equal <code>[{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}]</code>.'');'
testString: 'assert.deepEqual(filteredList, [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}], "<code>filteredList</code> should equal <code>[{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}]</code>.");'
```
@ -41,7 +41,7 @@ tests:
```js
// the global variable
var watchList = [
{
{
"Title": "Inception",
"Year": "2010",
"Rated": "PG-13",
@ -63,7 +63,7 @@ var watchList = [
"Type": "movie",
"Response": "True"
},
{
{
"Title": "Interstellar",
"Year": "2014",
"Rated": "PG-13",
@ -107,7 +107,7 @@ var watchList = [
"Type": "movie",
"Response": "True"
},
{
{
"Title": "Batman Begins",
"Year": "2005",
"Rated": "PG-13",
@ -159,7 +159,7 @@ var filteredList;
// Add your code above this line
console.log(filteredList);
console.log(filteredList);
```
</div>

View File

@ -24,13 +24,13 @@ The <code>watchList</code> array holds objects with information on several movie
```yml
tests:
- text: The <code>watchList</code> variable should not change.
testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", ''The <code>watchList</code> variable should not change.'');'
testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", "The <code>watchList</code> variable should not change.");'
- text: Your code should not use a <code>for</code> loop.
testString: 'assert(!code.match(/for\s*?\(.+?\)/g), ''Your code should not use a <code>for</code> loop.'');'
testString: 'assert(!code.match(/for\s*?\(.+?\)/g), "Your code should not use a <code>for</code> loop.");'
- text: Your code should use the <code>map</code> method.
testString: 'assert(code.match(/\.map/g), ''Your code should use the <code>map</code> method.'');'
testString: 'assert(code.match(/\.map/g), "Your code should use the <code>map</code> method.");'
- text: '<code>rating</code> should equal <code>[{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]</code>.'
testString: 'assert(JSON.stringify(rating) === JSON.stringify([{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]), ''<code>rating</code> should equal <code>[{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]</code>.'');'
testString: 'assert(JSON.stringify(rating) === JSON.stringify([{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]), "<code>rating</code> should equal <code>[{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]</code>.");'
```
@ -44,7 +44,7 @@ tests:
```js
// the global variable
var watchList = [
{
{
"Title": "Inception",
"Year": "2010",
"Rated": "PG-13",
@ -66,7 +66,7 @@ var watchList = [
"Type": "movie",
"Response": "True"
},
{
{
"Title": "Interstellar",
"Year": "2014",
"Rated": "PG-13",
@ -110,7 +110,7 @@ var watchList = [
"Type": "movie",
"Response": "True"
},
{
{
"Title": "Batman Begins",
"Year": "2005",
"Rated": "PG-13",
@ -165,7 +165,7 @@ for(var i=0; i < watchList.length; i++){
// Add your code above this line
console.log(rating);
console.log(rating);
```
</div>

View File

@ -23,13 +23,13 @@ The variable <code>watchList</code> holds an array of objects with information o
```yml
tests:
- text: The <code>watchList</code> variable should not change.
testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", ''The <code>watchList</code> variable should not change.'');'
testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", "The <code>watchList</code> variable should not change.");'
- text: Your code should use the <code>reduce</code> method.
testString: 'assert(code.match(/\.reduce/g), ''Your code should use the <code>reduce</code> method.'');'
testString: 'assert(code.match(/\.reduce/g), "Your code should use the <code>reduce</code> method.");'
- text: The <code>averageRating</code> should equal 8.675.
testString: 'assert(averageRating == 8.675, ''The <code>averageRating</code> should equal 8.675.'');'
testString: 'assert(averageRating == 8.675, "The <code>averageRating</code> should equal 8.675.");'
- text: Your code should not use a <code>for</code> loop.
testString: 'assert(!code.match(/for\s*?\(.*\)/g), ''Your code should not use a <code>for</code> loop.'');'
testString: 'assert(!code.match(/for\s*?\(.*\)/g), "Your code should not use a <code>for</code> loop.");'
```
@ -43,7 +43,7 @@ tests:
```js
// the global variable
var watchList = [
{
{
"Title": "Inception",
"Year": "2010",
"Rated": "PG-13",
@ -65,7 +65,7 @@ var watchList = [
"Type": "movie",
"Response": "True"
},
{
{
"Title": "Interstellar",
"Year": "2014",
"Rated": "PG-13",
@ -109,7 +109,7 @@ var watchList = [
"Type": "movie",
"Response": "True"
},
{
{
"Title": "Batman Begins",
"Year": "2005",
"Rated": "PG-13",
@ -161,7 +161,7 @@ var averageRating;
// Add your code above this line
console.log(averageRating);
console.log(averageRating);
```
</div>

View File

@ -22,13 +22,13 @@ Use the <code>some</code> method inside the <code>checkPositive</code> function
```yml
tests:
- text: Your code should use the <code>some</code> method.
testString: 'assert(code.match(/\.some/g), ''Your code should use the <code>some</code> method.'');'
testString: 'assert(code.match(/\.some/g), "Your code should use the <code>some</code> method.");'
- text: '<code>checkPositive([1, 2, 3, -4, 5])</code> should return <code>true</code>.'
testString: 'assert(checkPositive([1, 2, 3, -4, 5]), ''<code>checkPositive([1, 2, 3, -4, 5])</code> should return <code>true</code>.'');'
testString: 'assert(checkPositive([1, 2, 3, -4, 5]), "<code>checkPositive([1, 2, 3, -4, 5])</code> should return <code>true</code>.");'
- text: '<code>checkPositive([1, 2, 3, 4, 5])</code> should return <code>true</code>.'
testString: 'assert(checkPositive([1, 2, 3, 4, 5]), ''<code>checkPositive([1, 2, 3, 4, 5])</code> should return <code>true</code>.'');'
testString: 'assert(checkPositive([1, 2, 3, 4, 5]), "<code>checkPositive([1, 2, 3, 4, 5])</code> should return <code>true</code>.");'
- text: '<code>checkPositive([-1, -2, -3, -4, -5])</code> should return <code>false</code>.'
testString: 'assert(!checkPositive([-1, -2, -3, -4, -5]), ''<code>checkPositive([-1, -2, -3, -4, -5])</code> should return <code>false</code>.'');'
testString: 'assert(!checkPositive([-1, -2, -3, -4, -5]), "<code>checkPositive([-1, -2, -3, -4, -5])</code> should return <code>false</code>.");'
```
@ -42,8 +42,8 @@ tests:
```js
function checkPositive(arr) {
// Add your code below this line
// Add your code above this line
}
checkPositive([1, 2, 3, -4, 5]);