I am very new to Javascript, so I am having a hard time figuring out this easy exercise and what I'm doing this wrong. Any help would be greatly appreciated!
You are given two numeric variables: var n = 25; var result = 0;
Their values may change when you submit. DO NOT EDIT CODE ABOVE THIS LINE. =================================
Your Challenge: Using if and else, make decisions based on the values of n and result with the following rules: 1. When n is even, set the value of result to result's current value plus 10. 2. When n is odd, set the value of result to result's current value minus the value of n. 3. Do not declare new variables. 4. Be sure your solution works for all values of n and result.
if (n%2 == 0) {result+10;} else {result-n;}