3 ms·
I skimmed through the book and think I saw a function declared inside an if-statement. Some JS engines don't like that. And if the engine does support it, the f
by z3t4 7y ago
I skimmed through the book and think I saw a function declared inside an if-statement. Some JS engines don't like that. And if the engine does support it, the function will be function scoped. To make an if-scoped function, declare it using const f = x => y,
nitpick:
I personally prefer to use intermediate variables instead of nested function calls and ternary operator.