How would I remove _100 from the end of the string, It should be removed only at the end of the string. For e.g marks_old_100 should be "marks_old". marks_100 should be "marks".
function numInString(strs) {
let newStr = ''
for (let i = 0; i < strs.length; i++) {
let noNumRegex = /\d/
let isAlphRegex = /[a-zA-Z]$/
if (isAlphRegex.test(strs[i])) {
newStr += strs[i]
}
}
return newStr
}
console.log(numInString('marks_100'))