Live data from Hacker News

JavaScript Pattern Matching Proposal

github.com

1–10 of 254 posts

Re: JavaScript Pattern Matching Proposal

#2
I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.

Re: JavaScript Pattern Matching Proposal

#7

I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.

This should help you: http://2ality.com/2015/11/tc39-process.html

Basically, it's just a proposition for the moment, there's no telling if that's gonna be in the language or not. It's only at stage 2 that it is likely that the feature will be added in the language.

Re: JavaScript Pattern Matching Proposal

#8

Could someone please explain what this could be used for ?

So, there are example use cases in the proposal [1]. I think it's meant to standardize how we handle conditional inputs or shapes of inputs (some people use if statements, some switch, and others store it all in an object and use keys).

1. https://github.com/tc39/proposal-pattern-matching#motivating...

Re: JavaScript Pattern Matching Proposal

#9

I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.

Someone will surely do a Babel plugin to use the syntax allowing you to try it before it becomes an official feature.

Re: JavaScript Pattern Matching Proposal

#10

I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.

Right now this says it is a Stage 0 proposal, or "Strawman". It's to see if there is interest in the committee to pursue it. So it's hard to tell the likelihood if it will show up in browsers/Node just yet.

The TC39 process: https://tc39.github.io/process-document/

Post reply on HN