My task is to write a function that changes a string to an integer. If the value is greater than zero, I have to save it in a new array, if it is not to be filtered, the same as the digits that are in the array. tab1 = ['d', 'e', 3, 'h', 11, -2, 'P'] This is the board. Generally, it is a change according to ASCII, but with a slight change because, for example, d is to be written as 3, i.e. from each result, additional 97 should be subtracted. Can anyone help me with this? I absolutely do not know how to go about it :( So far I have managed to create so much; /
var tab1=['d','e',3,'h',11,-2,'P'];
let tab2=[];
function convertStingToInt(){
for (let i = 0; i < tab1.length; i++)
tab2 = tab1.charCodeAt([i]);
}
console.log(tab2);