It runs, but not because it should. Just because…javascript
Notice the ( before the keyword function? This means that this function is an IIFE (immediately invoked function expression).
It will automatically execute when it’s called, and it will assign it’s return value to the variable increment. And it’s return value is the next function.
So why shouldn’t it work?
// You are trying to assign a default value to
// the first number parameter
// but this runs immediately and never uses that variable
const increment = (function(number =+ 1) {
"use strict";
// you only have access to these parameters
// therefore only these can be set to defaults
return function increment(number, value) {
return number + value;
};
})();
From now if you see an IIFE, just keep in mind you don’t have access to those parameters (there is a way, but rarely used, so no need to complicate it)
So it runs in the repl because those values are never used. It fails FCC tests because they’re checking for another parameter to have a default value.