79458757

Date: 2025-02-21 22:35:05
Score: 1
Natty:
Report link

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.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Calvin Heath