I need help on that string task for a intership program(i have already handed over the tasks),but i really stuck in the start of the task.
enter image description here
const arr = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];
const getValue = (temp) => {
for (i = 0; i < 10; i++) {
if (temp === arr[i]) {
return i;
}
}
return;
}
const charToDigit = (digit) => {
let index = digit - 48;
return arr[index];
}
}
console.log(solve(“fiveplusfive”));