+123(45)678-9_-__
const index = str.search(/\d\D*$/);
// или
const index = str.replace(/\D*$/, '').length - 1;
// или
const index = [...str].reduce((max, n, i) => +n === +n ? i : max, -1);
// или
const index = +(Object.entries(str).filter(n => !isNaN(n[1])).pop() || [ -1 ])[0];
// или
let index = str.length;
while (--index >= 0 && !'0123456789'.includes(str[index])) ;
// или
const index = (function get(i, n = str.charAt(i)) {
return i < 0 || !Object.is(n * 1, NaN)
? i
: get(~-i);
})(~-str.length);