I have an array containing two strings: '1' and '5' for example. I want to save those two strings into parameters, but already as integer numbers. Currently, the code looks like this:
const data = ['1', '5'];
const [min_str, max_str] = data;
const min = parseInt(min_str, 10);
const max = parseInt(max_str, 10);
console.log(typeof min_str, typeof max_str, typeof min, typeof max)
Is there a way to reduce this code to one line, such that parseInt has already been applied to min_str and max_str?