fix(curriculum): Removed global variable and updated test for "Functional Programming: Apply Functional Programming to Convert Strings to URL Slugs" (#39359)
* Fixed Some Typos * Removed global variable and updated tests Co-authored-by: nakulnambiar <nakul.nambiar@demandfarm.com>
This commit is contained in:
@ -27,8 +27,6 @@ The output should not have any spaces
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: The <code>globalTitle</code> variable should not change.
|
||||
testString: assert(globalTitle === "Winter Is Coming");
|
||||
- text: Your code should not use the <code>replace</code> method for this challenge.
|
||||
testString: assert(!code.match(/\.?[\s\S]*?replace/g));
|
||||
- text: <code>urlSlug("Winter Is Coming")</code> should return <code>"winter-is-coming"</code>.
|
||||
@ -50,9 +48,6 @@ tests:
|
||||
<div id='js-seed'>
|
||||
|
||||
```js
|
||||
// The global variable
|
||||
var globalTitle = "Winter Is Coming";
|
||||
|
||||
// Only change code below this line
|
||||
function urlSlug(title) {
|
||||
|
||||
@ -71,9 +66,6 @@ function urlSlug(title) {
|
||||
<section id='solution'>
|
||||
|
||||
```js
|
||||
// The global variable
|
||||
var globalTitle = "Winter Is Coming";
|
||||
|
||||
// Only change code below this line
|
||||
function urlSlug(title) {
|
||||
return title.trim().split(/\s+/).join("-").toLowerCase();
|
||||
|
Reference in New Issue
Block a user