proposal-regexp-match-indices
proposal-nullish-coalescing
Our great sponsors
proposal-regexp-match-indices | proposal-nullish-coalescing | |
---|---|---|
4 | 5 | |
58 | 1,232 | |
- | - | |
1.0 | 0.0 | |
almost 2 years ago | about 1 year ago | |
HTML | HTML | |
BSD 3-clause "New" or "Revised" License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proposal-regexp-match-indices
-
Unveiling Breakthroughs Found In The State Of JS 2022 Survey
For more info about this feature, you can refer to the official proposal repo.
-
How JavaScript works: regular expressions (RegExp)
It should be mentioned that this feature isn't part of the ECMAScript specification yet. It's currently a stage 3 proposal and will likely be part of ES2021 or ES2022.
- Node.js 16 Available Now
-
ES 2021 features (all 5 of them)
RegExp Match Indices (?)
proposal-nullish-coalescing
-
Unveiling Breakthroughs Found In The State Of JS 2022 Survey
For more info about this feature, you can refer to the original proposal.
-
Javascript: El operador nullish-coalescing
Propuesta
-
PEP 505 – None-aware operators (2015)
For comparison, here are the Javascript RFCs for the equivalent operators:
https://github.com/TC39/proposal-optional-chaining
https://github.com/tc39/proposal-nullish-coalescing
IMO optional chaining is a lifesaver when dealing with deeply nested JSON, and it's become indispensable in our Typescript code. But we also deal with JSON from various third-party endpoints in Python, and far too often we resort to an inefficient deep_get utility to make our code sensical.
> if json?.get("foo")?.get("bar")?[0]?.get("baz")
may seem messy but would be infinitely better than the fragile (note the nested list-of-a-single-dict, and how bugs can appear if it's not there):
> if json.get("foo", {}).get("bar", [{}])[0].get("baz")
or the inefficient
> if deep_get(json, "foo.bar.0.baz")
It's not nearly as good as the Typescript json.foo?.bar?.[0]?.baz - but it's good enough!
- Stage 4: Nullish Coalescing for JavaScript
-
Using the optional chaining operator in JavaScript
The nullish coalescing proposal provides a way to handle undefined or null values and provide default values for the expression. You can use the “??” operator to provide a default value for an expression.
What are some alternatives?
iswasmfast - Performance comparison of WebAssembly, C++ Addon, and native implementations of various algorithms in Node.js.
proposal-top-level-await - top-level `await` proposal for ECMAScript (stage 4)
public-roadmap - Checkly public roadmap. All planned features, updates and tweaks.
proposals - Tracking ECMAScript Proposals
proposal-relative-indexing-method - A TC39 proposal to add an .at() method to all the basic indexable classes (Array, String, TypedArray)
proposal-optional-chaining
babel-sublime - Syntax definitions for ES6 JavaScript with React JSX extensions.
proposal-weakrefs - WeakRefs