diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.english.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.english.md
index 9b8882fafe..e6ec1cd2b2 100644
--- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.english.md
+++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.english.md
@@ -9,7 +9,7 @@ videoUrl: 'https://scrimba.com/p/pVMPUv/cra98AJ'
Implement a function which: Demonstrate that it passes the following three test-cases: Test Cases<!DOCTYPE ...>
tag on the first line, where the "...
" part is the version of HTML. For HTML5, you use <!DOCTYPE html>
.
+You tell the browser this information by adding the <!DOCTYPE ...>
tag on the first line, where the ...
part is the version of HTML. For HTML5, you use <!DOCTYPE html>
.
The !
and uppercase DOCTYPE
is important, especially for older browsers. The html
is not case sensitive.
Next, the rest of your HTML code needs to be wrapped in html
tags. The opening <html>
goes directly below the <!DOCTYPE html>
line, and the closing </html>
goes at the end of the page.
Here's an example of the page structure:
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-do...while-loops.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-do...while-loops.english.md
index dac93ad9b2..be7164f8df 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-do...while-loops.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-do...while-loops.english.md
@@ -7,7 +7,7 @@ videoUrl: 'https://scrimba.com/c/cDqWGcp'
## Description
do...while
" loop. It is called a do...while
loop because it will first "do
" one pass of the code inside the loop no matter what, and then continue to run the loop "while
" the specified condition evaluates to true
.
+The next type of loop you will learn is called a do...while
loop. It is called a do...while
loop because it will first do
one pass of the code inside the loop no matter what, and then continue to run the loop while
the specified condition evaluates to true
.
var ourArray = [];
The example above behaves similar to other types of loops, and the resulting array will look like
var i = 0;
do {
ourArray.push(i);
i++;
} while (i < 5);[0, 1, 2, 3, 4]
. However, what makes the do...while
different from other loops is how it behaves when the condition fails on the first check. Let's see this in action:
Here is a regular while
loop that will run the code in the loop as long as i < 5
:
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.english.md
index 4297a65368..b3c2888c0d 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.english.md
@@ -8,7 +8,7 @@ videoUrl: 'https://scrimba.com/c/c9yNVCe'
## Description
for loop
" because it runs "for" a specific number of times.
+The most common type of JavaScript loop is called a for loop
because it runs "for" a specific number of times.
For loops are declared with three optional expressions separated by semicolons:
for ([initialization]; [condition]; [final-expression])
The initialization
statement is executed one time only before the loop starts. It is typically used to define and setup your loop variable.
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops.english.md
index 1b3e1713b9..80b289697d 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops.english.md
@@ -8,7 +8,7 @@ videoUrl: 'https://scrimba.com/c/c8QbnCM'
## Description
while
" loop because it runs "while" a specified condition is true and stops once that condition is no longer true.
+The first type of loop we will learn is called a while
loop because it runs "while" a specified condition is true and stops once that condition is no longer true.
var ourArray = [];
Let's try getting a while loop to work by pushing values to an array.
var i = 0;
while(i < 5) {
ourArray.push(i);
i++;
}Object.prototype
is the prototype of Dog.prototype
")
+ - text: Your code should show that Object.prototype
is the prototype of Dog.prototype
testString: assert(/Object\.prototype\.isPrototypeOf/.test(code), "Your code should show that Object.prototype
is the prototype of Dog.prototype
");
```
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.english.md
index a1e254c5b8..951d083b09 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.english.md
@@ -24,20 +24,20 @@ Write a greedy
regex that finds one or more criminals within a grou
```yml
tests:
- - text: Your regex should match one
criminal ("C
") in "C"
- testString: assert('C'.match(reCriminals) && 'C'.match(reCriminals)[0] == 'C', 'Your regex should match one
criminal ("C
") in "C"
');
- - text: Your regex should match two
criminals ("CC
") in "CC"
- testString: assert('CC'.match(reCriminals) && 'CC'.match(reCriminals)[0] == 'CC', 'Your regex should match two
criminals ("CC
") in "CC"
');
- - text: Your regex should match three
criminals ("CCC
") in "P1P5P4CCCP2P6P3"
- testString: assert('P1P5P4CCCP2P6P3'.match(reCriminals) && 'P1P5P4CCCP2P6P3'.match(reCriminals)[0] == 'CCC', 'Your regex should match three
criminals ("CCC
") in "P1P5P4CCCP2P6P3"
');
- - text: Your regex should match five
criminals ("CCCCC
") in "P6P2P7P4P5CCCCCP3P1"
- testString: assert('P6P2P7P4P5CCCCCP3P1'.match(reCriminals) && 'P6P2P7P4P5CCCCCP3P1'.match(reCriminals)[0] == 'CCCCC', 'Your regex should match five
criminals ("CCCCC
") in "P6P2P7P4P5CCCCCP3P1"
');
+ - text: Your regex should match one
criminal (C
) in "C"
+ testString: assert('C'.match(reCriminals) && 'C'.match(reCriminals)[0] == 'C', 'Your regex should match one
criminal (C
) in "C"
');
+ - text: Your regex should match two
criminals (CC
) in "CC"
+ testString: assert('CC'.match(reCriminals) && 'CC'.match(reCriminals)[0] == 'CC', 'Your regex should match two
criminals (CC
) in "CC"
');
+ - text: Your regex should match three
criminals (CCC
) in "P1P5P4CCCP2P6P3"
+ testString: assert('P1P5P4CCCP2P6P3'.match(reCriminals) && 'P1P5P4CCCP2P6P3'.match(reCriminals)[0] == 'CCC', 'Your regex should match three
criminals (CCC
) in "P1P5P4CCCP2P6P3"
');
+ - text: Your regex should match five
criminals (CCCCC
) in "P6P2P7P4P5CCCCCP3P1"
+ testString: assert('P6P2P7P4P5CCCCCP3P1'.match(reCriminals) && 'P6P2P7P4P5CCCCCP3P1'.match(reCriminals)[0] == 'CCCCC', 'Your regex should match five
criminals (CCCCC
) in "P6P2P7P4P5CCCCCP3P1"
');
- text: Your regex should not match any criminals in ""
testString: assert(!reCriminals.test(''), 'Your regex should not match any criminals in ""
');
- text: Your regex should not match any criminals in "P1P2P3"
testString: assert(!reCriminals.test('P1P2P3'), 'Your regex should not match any criminals in "P1P2P3"
');
- - text: Your regex should match fifty
criminals ("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
") in "P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3"
.
- testString: assert('P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3'.match(reCriminals) && 'P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3'.match(reCriminals)[0] == "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", 'Your regex should match fifty
criminals ("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
") in "P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3"
.');
+ - text: Your regex should match fifty
criminals (CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
) in "P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3"
.
+ testString: assert('P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3'.match(reCriminals) && 'P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3'.match(reCriminals)[0] == "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", 'Your regex should match fifty
criminals (CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
) in "P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3"
.');
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md
index 475df7f944..2c9e74e3e4 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/data-structures/perform-a-subset-check-on-two-sets-of-data.english.md
@@ -24,13 +24,13 @@ tests:
testString: assert((function(){var test = new Set(); return (typeof test.subset === 'function')})(), 'Your Set
class should have a union
method.');
- text: The first Set() was contained in the second Set
testString: assert((function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setB.add('b'); setB.add('c'); setB.add('a'); setB.add('d'); var subsetSetAB = setA.subset(setB);return (subsetSetAB === true)})(), 'The first Set() was contained in the second Set');
- - text: ['a', 'b'].subset(['a', 'b', 'c', 'd'])
should return true
")
+ - text: ['a', 'b'].subset(['a', 'b', 'c', 'd'])
should return true
testString: assert((function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setB.add('a'); setB.add('b'); setB.add('c'); setB.add('d'); var subsetSetAB = setA.subset(setB); return (subsetSetAB === true)})(), "['a', 'b'].subset(['a', 'b', 'c', 'd'])
should return true
");
- - text: ['a', 'b', 'c'].subset(['a', 'b'])
should return false
")
+ - text: ['a', 'b', 'c'].subset(['a', 'b'])
should return false
testString: assert((function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setA.add('c'); setB.add('a'); setB.add('b'); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)})(), "['a', 'b', 'c'].subset(['a', 'b'])
should return false
");
- text: [].subset([])
should return true
testString: assert((function(){var setA = new Set(); var setB = new Set(); var subsetSetAB = setA.subset(setB); return (subsetSetAB === true)})(), '[].subset([])
should return true
');
- - text: ['a', 'b'].subset(['c', 'd'])
should return false
")
+ - text: ['a', 'b'].subset(['c', 'd'])
should return false
testString: assert((function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setB.add('c'); setB.add('d'); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)})(), "['a', 'b'].subset(['c', 'd'])
should return false
");
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md
index b7c79d6525..7fc63db3ac 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md
@@ -9,7 +9,7 @@ challengeType: 5
Task:
100
), and
-returns a string which shows the same duration decomposed into weeks, days, hours, minutes, and seconds as detailed below (e.g., "1 min, 40 sec
").
+returns a string which shows the same duration decomposed into weeks, days, hours, minutes, and seconds as detailed below (e.g., 1 min, 40 sec
).
@@ -67,7 +67,7 @@ The following five units should be used:
-However, only include quantities with non-zero values in the output (e.g., return "1 d
" and not "0 wk, 1 d, 0 hr, 0 min, 0 sec
").Give larger units precedence over smaller ones as much as possible (e.g., return 2 min, 10 sec
and not 1 min, 70 sec
or 130 sec
)Mimic the formatting shown in the test-cases (quantities sorted from largest unit to smallest and separated by comma+space; value and unit of each quantity separated by space).
+However, only include quantities with non-zero values in the output (e.g., return 1 d
and not 0 wk, 1 d, 0 hr, 0 min, 0 sec
).Give larger units precedence over smaller ones as much as possible (e.g., return 2 min, 10 sec
and not 1 min, 70 sec
or 130 sec
)Mimic the formatting shown in the test-cases (quantities sorted from largest unit to smallest and separated by comma+space; value and unit of each quantity separated by space).
factorial
is a function.');
- text: factorial(2)
should return a number.
testString: assert(typeof factorial(2) === 'number', 'factorial(2)
should return a number.');
- - text: factorial(3)
should return 6.")
+ - text: factorial(3)
should return 6.
testString: assert.equal(factorial(3),results[0],"factorial(3)
should return 6.");
- - text: factorial(3)
should return 120.")
+ - text: factorial(3)
should return 120.
testString: assert.equal(factorial(5),results[1],"factorial(3)
should return 120.");
- - text: factorial(3)
should return 3,628,800.")
+ - text: factorial(3)
should return 3,628,800.
testString: assert.equal(factorial(10),results[2],"factorial(3)
should return 3,628,800.");
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md
index dea4effb64..2651dc2f95 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md
@@ -28,11 +28,11 @@ tests:
testString: assert(typeof fibonacci === 'function', 'fibonacci
is a function.');
- text: fibonacci(2)
should return a number.
testString: assert(typeof fibonacci(2) == 'number', 'fibonacci(2)
should return a number.');
- - text: fibonacci(3)
should return 1.")
+ - text: fibonacci(3)
should return 1.
testString: assert.equal(fibonacci(3),1,"fibonacci(3)
should return 1.");
- - text: fibonacci(5)
should return 3.")
+ - text: fibonacci(5)
should return 3.
testString: assert.equal(fibonacci(5),3,"fibonacci(5)
should return 3.");
- - text: fibonacci(10)
should return 34.")
+ - text: fibonacci(10)
should return 34.
testString: assert.equal(fibonacci(10),34,"fibonacci(10)
should return 34.");
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md
index 96ba4b3a2e..f8cca3d3ac 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md
@@ -59,9 +59,9 @@ for examples of native data structures.)
tests:
- text: parseSexpr
is a function.
testString: assert(typeof parseSexpr === 'function', 'parseSexpr
is a function.');
- - text: parseSexpr('(data1 data2 data3)')
should return ['data1', 'data2', 'data3']")
+ - text: parseSexpr('(data1 data2 data3)')
should return ['data1', 'data2', 'data3']
testString: assert.deepEqual(parseSexpr(simpleSExpr), simpleSolution, "parseSexpr('(data1 data2 data3)')
should return ['data1', 'data2', 'data3']");
- - text: parseSexpr('(data1 data2 data3)')
should return an array with 3 elements")
+ - text: parseSexpr('(data1 data2 data3)')
should return an array with 3 elements.
testString: assert.deepEqual(parseSexpr(basicSExpr), basicSolution, "parseSexpr('(data1 data2 data3)')
should return an array with 3 elements");
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md
index 7922f8cdaa..3e7faedc52 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md
@@ -52,13 +52,13 @@ challengeType: 5
tests:
- text: sedol
is a function.
testString: assert(typeof sedol === 'function', 'sedol
is a function.');
- - text: sedol('a')
should return null.")
+ - text: sedol('a')
should return null.
testString: assert(sedol('a') === null, "sedol('a')
should return null.");
- - text: sedol('710889')
should return '7108899'.")
+ - text: sedol('710889')
should return '7108899'.
testString: assert(sedol('710889') === '7108899', "sedol('710889')
should return '7108899'.");
- - text: sedol('BOATER')
should return null.")
+ - text: sedol('BOATER')
should return null.
testString: assert(sedol('BOATER') === null, "sedol('BOATER')
should return null.");
- - text: sedol('228276')
should return '2282765'.")
+ - text: sedol('228276')
should return '2282765'.
testString: assert(sedol('228276') === '2282765', "sedol('228276')
should return '2282765'.");
```
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md
index 4c6b86df76..84d32d1d1d 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md
@@ -47,7 +47,7 @@ tests:
testString: assert(typeof tokenize === 'function', 'tokenize
is a function.');
- text: tokenize
should return an array.
testString: assert(typeof tokenize('a', 'b', 'c') === 'object', 'tokenize
should return an array.');
- - text: tokenize('one^|uno||three^^^^|four^^^|^cuatro|', '|', '^')
should return ['one|uno', '', 'three^^', 'four^|cuatro', '']")
+ - text: tokenize('one^|uno||three^^^^|four^^^|^cuatro|', '|', '^')
should return ['one|uno', '', 'three^^', 'four^|cuatro', '']
testString: assert.deepEqual(tokenize(testStr1, '|', '^'), res1, "tokenize('one^|uno||three^^^^|four^^^|^cuatro|', '|', '^')
should return ['one|uno', '', 'three^^', 'four^|cuatro', '']");
- text: tokenize('a@&bcd&ef&&@@hi', '&', '@')
should return ['a&bcd', 'ef', '', '@hi']
testString: assert.deepEqual(tokenize(testStr2, '&', '@'), res2, 'tokenize("a@&bcd&ef&&@@hi", "&", "@")
should return ["a&bcd", "ef", "", "@hi"]
');
diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md
index 86eafb0bb2..6ab9a824d6 100644
--- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md
+++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md
@@ -33,11 +33,11 @@ tests:
testString: assert(typeof towerOfHanoi === 'function', 'towerOfHanoi
is a function.');
- text: towerOfHanoi(3, ...)
should return 7 moves.
testString: assert(res3.length === 7, 'towerOfHanoi(3, ...)
should return 7 moves.');
- - text: towerOfHanoi(3, 'A', 'B', 'C')
should return [['A','B'],['A','C'],['B','C'],['A','B'],['C','A'],['C','B'],['A','B']].")
+ - text: towerOfHanoi(3, 'A', 'B', 'C')
should return [['A','B'],['A','C'],['B','C'],['A','B'],['C','A'],['C','B'],['A','B']]
testString: assert.deepEqual(towerOfHanoi(3, 'A', 'B', 'C'), res3Moves, "towerOfHanoi(3, 'A', 'B', 'C')
should return [['A','B'],['A','C'],['B','C'],['A','B'],['C','A'],['C','B'],['A','B']].");
- text: towerOfHanoi(5, "X", "Y", "Z")
10th move should be Y -> X.
testString: assert.deepEqual(res5[9], ['Y', 'X'], 'towerOfHanoi(5, "X", "Y", "Z")
10th move should be Y -> X.');
- - text: towerOfHanoi(7, 'A', 'B', 'C')
first ten moves are [['A','B'],['A','C'],['B','C'],['A','B'],['C','A'],['C','B'],['A','B'],['A','C'],['B','C'],['B','A']].")
+ - text: towerOfHanoi(7, 'A', 'B', 'C')
first ten moves are [['A','B'],['A','C'],['B','C'],['A','B'],['C','A'],['C','B'],['A','B'],['A','C'],['B','C'],['B','A']]
testString: assert.deepEqual(towerOfHanoi(7, 'A', 'B', 'C').slice(0, 10), res7First10Moves, "towerOfHanoi(7, 'A', 'B', 'C')
first ten moves are [['A','B'],['A','C'],['B','C'],['A','B'],['C','A'],['C','B'],['A','B'],['A','C'],['B','C'],['B','A']].");
```