Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 346 Bytes

Remove First and Last Character.md

File metadata and controls

11 lines (8 loc) · 346 Bytes

Description:

It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the original string. You don't have to worry with strings with less than two characters.

Solution:

function removeChar(str) {
  return str.slice(1, -1);
}