Clarify description of Bonfire - Drop it
- Added Description - Added MDN link to solve using Array.prototype.slice method
This commit is contained in:
@ -793,6 +793,7 @@
|
|||||||
"title": "Drop it",
|
"title": "Drop it",
|
||||||
"description": [
|
"description": [
|
||||||
"Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.",
|
"Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.",
|
||||||
|
"Return the rest of the array, otherwise return an empty array.",
|
||||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code."
|
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -813,7 +814,8 @@
|
|||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Arguments object",
|
"Arguments object",
|
||||||
"Array.shift()"
|
"Array.shift()",
|
||||||
|
"Array.slice()"
|
||||||
],
|
],
|
||||||
"solutions": [
|
"solutions": [
|
||||||
"function drop(arr, func) {\n // Drop them elements.\n while (arr.length && !func(arr[0])) {\n arr.shift();\n }\n return arr;\n}"
|
"function drop(arr, func) {\n // Drop them elements.\n while (arr.length && !func(arr[0])) {\n arr.shift();\n }\n return arr;\n}"
|
||||||
|
Reference in New Issue
Block a user