public/subjects/keep
Clement Denis d3a8b56646 discovery-js: add more exercises 2021-05-05 23:27:11 +01:00
..
README.md discovery-js: add more exercises 2021-05-05 23:27:11 +01:00

README.md

Keep

Instructions

Using the .slice method again and the provided alphabet variable of a string of all the characters in an alphabet:

  • Declare a keepFirst variable of only the 6 first characters from alphabet.
  • Declare a keepLast variable of only the 7 last characters from alphabet.
  • Declare a keepFirstLast variable of the 3 first characters and 4 last characters from alphabet.

Example: if alphabet value is 'abcdefghijklmnopqrstuvwxyz'

  • keepFirst must be 'abcdef'
  • keepLast must be 'tuvwxyz'
  • keepFirstLast must be 'abcwxyz'

Notions