Hey man, so I was stuck for a few minutes on this until I realized I hadn’t saved my code. I know it might seem silly but make sure that you are saving your code before running the test. If your code looks like what I have below then it should pass the test!
const _ = {
clamp(number, lower, upper) {
const lowerClampedValue = Math.max(number, lower);
const clampedValue = Math.min(lowerClampedValue, upper);
return clampedValue;
}
};
// Do not write or modify code below this line.
module.exports = _ ;
Hi. I’ve saved the code and the problem persists. My code is the same as yours. Take a look at the attached image, please, and see if you can find what might be wrong.
Hey man it looks like you’re missing a closing bracket thats all. you have this: let _ = { clamp(number, lower, upper) { let lowerClampedValue = Math.max(number, lower); let clampedValue = Math.min(lowerClampedValue, upper); return clampedValue; }
After return clampedValue you should something like this
Also I would refrain from using let to set “_” since it shouldn’t be changed later on. Your code will work but it’s not wise to use “let” everywhere. Remember use “const” when a variable’s value should not be changed and only use “var” or “let” when you know your variable may be changing later on.