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