javascript string except last character code example Example: javascript string except last character id.slice(0, -2)