Avoid Mutations and Side Effects Using Functional Programming.js

what wrong i m doing ,
not passing challenge
Tell us what’s happening:

Your code so far


// The global variable
var fixedValue = 4;
function incrementer (){
// Only change code below this line
   return fixedValue + 1;
// Only change code above this line
}
var newValue = incrementer();
   console.log(fixedValue);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36.

Challenge: Avoid Mutations and Side Effects Using Functional Programming

Link to the challenge:

Hi, @rajeshkumar1

  1. If you use fixedValue+1 then please increment first and assign the incremented value in a variable or in fixedValue variable itself and then return that variable from function.

  2. You can also try increment operator here (```return ++fixedValue), if you are not familiar with it. you can refer below mentioned link.

Note - Actually point is simple first store incremented value and then return, In your code you are returning incremented value before storing anywhere.

Hi, @dev-313
Thank you

Please note that changing fixedValue is wrong as it is a side effects. fixedValue++ or ++fixedValue should not be correct solutions.