const index = str.search(/\d/);
.const index = str.match(/^(\D*\d)?/)[0].length - 1;
// или
const index = [...str].findIndex(n => !Number.isNaN(+n));
// или
let index = -1;
for (let i = 0; i < str.length; i++) {
if ('0123456789'.includes(str[i])) {
index = i;
break;
}
}