3 ms·
I've seen code like that in production, it's not as strange as you think (pretty common in reactjs codebase). After a while, you just get used to it and read pa
by nvlled 2y ago
I've seen code like that in production, it's not as strange as you think (pretty common in reactjs codebase). After a while, you just get used to it and read past the weird syntax. It's not really that different from a switch-case or if-else block:
function member(item, x) {
return /* if */ is_null(x)
? /* then */ null
: /* elif */ item === head(x)
? /* then */ x
: /* else */ member(item, tail(x));
}