JavaScript does not have native support for match
statement introduced in other languages
such as [Rust][rust-match-doc], [PHP][php-match-doc] and most recently [Python][py-match-doc].
The main advantage of match
is that it provides a more concise and readable way to
handle multiple conditions compared to switch
statement or if-elseif-else
chain.
This gist demonstrates a possible implementation of such functionality in JavaScript.