diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.english.md index 94ab69f38e..f930608b8a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.english.md @@ -22,10 +22,12 @@ Use the .length property to count the number of characters in the < ```yml tests: + - text: 'You should not change the variable declarations in the // Setup section.' + testString: assert(code.match(/var lastNameLength = 0;/) && code.match(/var lastName = "Lovelace";/)); - text: lastNameLength should be equal to eight. - testString: assert((function(){if(typeof lastNameLength !== "undefined" && typeof lastNameLength === "number" && lastNameLength === 8){return true;}else{return false;}})(), 'lastNameLength should be equal to eight.'); + testString: assert(typeof lastNameLength !== 'undefined' && lastNameLength === 8); - text: 'You should be getting the length of lastName by using .length like this: lastName.length.' - testString: 'assert((function(){if(code.match(/\.length/gi) && code.match(/\.length/gi).length >= 2 && code.match(/var lastNameLength \= 0;/gi) && code.match(/var lastNameLength \= 0;/gi).length >= 1){return true;}else{return false;}})(), ''You should be getting the length of lastName by using .length like this: lastName.length.'');' + testString: assert(code.match(/=\s*lastName\.length/g) && !code.match(/lastName\s*=\s*8/)); ``` @@ -56,16 +58,6 @@ lastNameLength = lastName; - -### After Test -
- -```js -if(typeof lastNameLength !== "undefined"){(function(){return lastNameLength;})();} -``` - -
- ## Solution