how to remove last character from string in javascrip code example Example: how to remove lasr char from string in javascript str=str.slice(0, -1);