trim first and last 3 character javascript code example Example: remove first and last character from string javascript const removeChar = (str) => str.slice(1, -1);