pull/1857/head
benmcmahon100 2015-08-17 14:11:49 +01:00
parent fe102bdf51
commit 1ce1c75c4d
1 changed files with 2 additions and 2 deletions

View File

@ -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>&thinsp;&thinsp;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');"
],