`slice(0, -1)` will remove the last char according to the JavaScript docs.