+ 1

How can I display the equation?

https://code.sololearn.com/We1rSdjApTeH/#html I want this to display the equation it used to get the final result So for the challenge example, they used 135 So the equation is 1^1+3^2+5^3 How can I make it display this? Remember, I don't want that specific equation I want it to show the equation for the number the user typed So if the input is..lets say 3783 it'd be 3^1+7^2+8^3+3^4

30th Sep 2018, 4:11 AM
Daniel Cooper
Daniel Cooper - avatar
1 Respuesta
+ 2
Try var output = input.toString().split("").map((v,i)=>v+"^"+(i+1)).join("+"); https://code.sololearn.com/WgC2rOj3JCsX/?ref=app
30th Sep 2018, 4:27 AM
Calviղ
Calviղ - avatar