A function is needed that converts hex letters into decimal numbers. A -> 10 , F -> 15 and so on. The higher the threshold (large ss, where X also a letter), the better.
|
1 answer
let result = parseInt("1f", 16); console.log(result); // -> 31 result = parseInt("1h", 19); console.log(result); // -> 36 parseInt mdn
Here the first parameter is the required number, and the second is the number system.
|