Pattern matching for JavaScript.