As in the string, remove certain text on the back?

Hello. As found in the line of the string and remove it?
const toDelete = '-10';
const name = 'windows-10-x64-10';

//the result
console.log(name); // windows-10-x64
June 10th 19 at 15:12
1 answer
June 10th 19 at 15:14
well, the joke is that it removes the first 10ку - pauline.Herman commented on June 10th 19 at 15:17
why? add to the regular season, the end of line character and all. - Rex.Bayer90 commented on June 10th 19 at 15:20

Find more questions by tags JavaScript