You can build multi-digit numbers from consecutive characters like this:
let values = [1, 2, 6];
let output = 0;
for (let i of values) {
// Multiplying by 10 shifts the number left.
output = output * 10 + Number(i);
}
console.log(output) // 126
This array ['1','2','6']
will also output 126
.