Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 664 Bytes

File metadata and controls

20 lines (14 loc) · 664 Bytes

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.

String.prototype.slice()

function removeChar(str){
 //You got this!
  return str.slice(1, -1);
};

String.prototype.substring()

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