Skip to main content
Added long version
Source Link
Oriol
  • 820
  • 6
  • 10

JavaScript (ES6)

Short version:

[72,101,108,108,111,32,87,111,114,108,100,33] .map(i => String.fromCharCode(i)) .reduce((i,j) => i+j) 

Long version:

[1089,11089,22753,35749,48070,55639,56663,68984,80648,92312,102513,107697] .reverse() .map((i,j,k) => i-(++j==k.length ? 0 : k[j])) .reverse() .map(i => Math.sqrt(i)) .reverse() .map(i => String.fromCharCode(i)) .reduce((i,j) => i+j) 

If anyone is interested, the array is obtained using

"Hello World!" .split('') .map(i => String.charCodeAt(i,0)) .reverse() .map(i => i*i) .map((i,j,k) => k.slice(0,j+1) .reduce((i,j) => i+j,0)) 

JavaScript (ES6)

[72,101,108,108,111,32,87,111,114,108,100,33] .map(i => String.fromCharCode(i)) .reduce((i,j) => i+j) 

JavaScript (ES6)

Short version:

[72,101,108,108,111,32,87,111,114,108,100,33] .map(i => String.fromCharCode(i)) .reduce((i,j) => i+j) 

Long version:

[1089,11089,22753,35749,48070,55639,56663,68984,80648,92312,102513,107697] .reverse() .map((i,j,k) => i-(++j==k.length ? 0 : k[j])) .reverse() .map(i => Math.sqrt(i)) .reverse() .map(i => String.fromCharCode(i)) .reduce((i,j) => i+j) 

If anyone is interested, the array is obtained using

"Hello World!" .split('') .map(i => String.charCodeAt(i,0)) .reverse() .map(i => i*i) .map((i,j,k) => k.slice(0,j+1) .reduce((i,j) => i+j,0)) 
Source Link
Oriol
  • 820
  • 6
  • 10

JavaScript (ES6)

[72,101,108,108,111,32,87,111,114,108,100,33] .map(i => String.fromCharCode(i)) .reduce((i,j) => i+j)