Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality. Learn more →
Proposal-nullish-coalescing Alternatives
Similar projects and alternatives to proposal-nullish-coalescing
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
proposal-nullish-coalescing reviews and mentions
-
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.
-
A note from our sponsor - InfluxDB
www.influxdata.com | 28 Apr 2024
Stats
The primary programming language of proposal-nullish-coalescing is HTML.
Sponsored