The function expressions are all anonymous, but then they're given a name afterward.
Consider
function hof(fn) {
setTimeout(() => console.log(fn(5)), 1000);
}
hof(x => x * x);
You could argue that this is "more anonymous", but it's also assigned into a variable called fn. It's no less or more anonymous than const square = x => x * x;.
You could maybe use an IIFE to be "truly anonymous", but... this is just splitting hairs really. Any function expression is an anonymous function.
9
u/[deleted] Apr 14 '24
[removed] — view removed comment