How to remove the last n characters from a JavaScript string

How to remove the last n characters from a JavaScript string

More to explore

Based on this image's title: “How to remove the last n characters from a JavaScript string