-5
Uncomplicated:
Since no one posted the most basic code, here goes:
function dobroDoProximo(atual){
return (atual+1)*2;
}
Demonstration:
function dobroDoProximo(atual){
return (atual+1)*2;
}
console.log(dobroDoProximo(4)); // tem que ser 10
console.log(dobroDoProximo(0)); // tem que ser 2
console.log(dobroDoProximo(417)); // tem que ser 836
Put some example of the output you want, it is very confusing the text.
– leofalmeida
I added an image, see if it helps
– Diogo Serravalle
I just think it’s bad that the solutions people give always involve unnecessary variables and more complex solution than it should, sometimes for lack of math, and that some say it’s more readable to write more code (Writing unnecessary code was never readable, but now is the preferred excuse).
– Maniero
If it were Black Friday it would be
metadeDoDobro()
– Bacco