|
|
@ -2,17 +2,17 @@ |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
|
|
Create the `slice` function that works like `Array.slice` and `String.slice` |
|
|
|
Create a function named `slice` that works like `Array.slice()` and `String.slice()`. |
|
|
|
|
|
|
|
|
|
|
|
It takes an additional first argument which is the string or the array |
|
|
|
It takes an additional first argument which is the string or the array. |
|
|
|
|
|
|
|
|
|
|
|
### Notions |
|
|
|
### Notions |
|
|
|
|
|
|
|
|
|
|
|
- [devdocs.io/javascript/global_objects/array/slice](https://devdocs.io/javascript/global_objects/array/slice) |
|
|
|
- [Array.slice](https://devdocs.io/javascript/global_objects/array/slice) |
|
|
|
|
|
|
|
|
|
|
|
### Code provided |
|
|
|
### Code provided |
|
|
|
|
|
|
|
|
|
|
|
> all code provided will be added to your solution and doesn't need to be submited. |
|
|
|
> The provided code will be added to your solution, and does not need to be submitted. |
|
|
|
|
|
|
|
|
|
|
|
```js |
|
|
|
```js |
|
|
|
Array.prototype.slice = undefined |
|
|
|
Array.prototype.slice = undefined |
|
|
|