how to delete last 2 character from a string in js code example Example: js remove last character from string let str = "Hello Worlds"; str = str.slice(0, -1);