by ducharmdev · 5y ago · 0 comments
let factorial = n => n === 0
? 1
: factorial(n - 1) * n;
But I do wish JavaScript had some more powerful pattern-matching syntax. For example, both Rust and C# both have nice switch/match expressions that can really simplify code like this.No comments yet.