|
|
@ -2,24 +2,20 @@ |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
|
|
Create the `cutFirst` function that takes a string |
|
|
|
Create some functions, which each take a `string` as an argument: |
|
|
|
and remove the 2 first characters. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create the `cutLast` function that takes a string |
|
|
|
- `cutFirst`: returns the string with the first 2 characters removed. |
|
|
|
and remove the 2 last characters. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create the `cutFirstLast` function that takes a string as parameter |
|
|
|
- `cutLast` returns the string with the last 2 characters removed. |
|
|
|
and remove the 2 first characters and 2 last characters. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a `keepFirst` function that takes a string as parameter |
|
|
|
- `cutFirstLast` returns the string with the first 2 characters and the last 2 characters removed. |
|
|
|
and return the string only keeping the 2 first characters. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a `keepLast` function that takes a string as parameter |
|
|
|
- `keepFirst` returns only the first 2 characters. |
|
|
|
and return the string only keeping the 2 last characters. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a `keepFirstLast` function that takes a string as parameter |
|
|
|
- `keepLast` returns only the last 2 characters. |
|
|
|
and only keep 2 first characters and 2 last characters. |
|
|
|
|
|
|
|
|
|
|
|
- `keepFirstLast` returns the first 2 characters, and the last 2 characters. |
|
|
|
|
|
|
|
|
|
|
|
### 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) |
|
|
|