Fix #1835
parent
fe102bdf51
commit
1ce1c75c4d
|
@ -233,13 +233,13 @@
|
|||
"difficulty":0,
|
||||
"description":[
|
||||
"filter is a useful method that can filter out values that don't match a certain criteria",
|
||||
"Let's remove all the values greater than six",
|
||||
"Let's remove all the values greater than five",
|
||||
"<code>array = array.filter(function(val) {</code>",
|
||||
"<code>  return(val<4);</code>",
|
||||
"<code>});</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert.deepEqual(array, [1,2,3,4,5], 'You should have removed all the values from the array that are less than six');",
|
||||
"assert.deepEqual(array, [1,2,3,4,5], 'You should have removed all the values from the array that are greater than five');",
|
||||
"assert(editor.getValue().match(/array\\.filter\\(/gi), 'You should be using the filter method to remove the values from the array');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7\\,8\\,9\\,10\\]/gi), 'You should only be using .filter to modify the contents of the array');"
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue