DEV Community

Cover image for #7DaysJS: myElement + n
Lautaro Lobo
Lautaro Lobo

Posted on • Originally published at on

#7DaysJS: myElement + n

Welcome to day 6 of 7 Days of JavaScript!

Let’s see, I got a nice one for today.

Given an array and a number n, return the array with each element summed to n.

Here’s an example:


If you want, you can also return the output as a string - If that makes it easier for you, it’s OK.

You can check out the solution algorithm here.

Top comments (0)