TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Two Features of JavaScript that you might not know

59 pointsby illuminatedalmost 5 years ago

9 comments

Legogrisalmost 5 years ago
I find the linked post about two new features in Node.js 14[0] much more interesting:<p>&gt; Optional Chaining operator (?.)<p>&gt; Nullish Coalescing operator (??)<p>Esp chaining can have a huge impact on readability.<p>[0]: <a href="https:&#x2F;&#x2F;www.monkwhocode.com&#x2F;2020&#x2F;05&#x2F;nodejs-v14-2-things-to-know.html" rel="nofollow">https:&#x2F;&#x2F;www.monkwhocode.com&#x2F;2020&#x2F;05&#x2F;nodejs-v14-2-things-to-k...</a>
评论 #24070702 未加载
评论 #24071219 未加载
评论 #24087796 未加载
评论 #24071874 未加载
评论 #24070830 未加载
评论 #24070991 未加载
评论 #24071268 未加载
neurotracealmost 5 years ago
Why in the world would you put a near full-page sized ad at the top of the article? I seriously thought that the site had been hijacked at first
评论 #24071659 未加载
评论 #24071426 未加载
评论 #24073229 未加载
评论 #24071363 未加载
adamklalmost 5 years ago
A few more items added to the kitchen sink that is JavaScript.<p>JavaScript&#x27;s multi-paradigm approach is one of its strengths, but, in my opinion, a weakness at the same time.<p>It allows people to write JavaScript following whatever approach suits them, which is fine for individual developers and small teams, but expand beyond that and it becomes a big ask for every developer to be up to speed with every feature JavaScript supports.<p>I use and teach JavaScript&#x2F;TypeScript every day, and its possible to be very productive with it, but I prefer the approaches of Go and Clojure better. Limited languages that support a single paradigm, and support it well.
评论 #24071176 未加载
评论 #24071312 未加载
评论 #24071337 未加载
评论 #24071190 未加载
buraksaricaalmost 5 years ago
This link contains the biggest header ad I&#x27;ve ever seen. Is it on purpose? Or is it just on my machine?
评论 #24070960 未加载
klodolphalmost 5 years ago
As a minor note—the exponentiation operator was added in ES2016 &#x2F; ES7, not ES2015 &#x2F; ES6. It wouldn’t matter, except you need to tell all your tools (Terser, etc.) that you are using ES2016 or they will throw syntax errors when processing your code.
sagoalmost 5 years ago
tldr: If you don&#x27;t want to scroll down the massive header and repeated statement of the title:<p>1. Double asterisk is the exponentiation operator.<p>2. _ can be used in numbers, e.g. 1_000_000<p>Also (and not in the article) both are also true in Python.
评论 #24076274 未加载
zachrosealmost 5 years ago
I was expecting this to be about object literal setters (and getters):<p><pre><code> const language = { set current(name) { this.log.push(name); }, log: [] }; </code></pre> Supported by browsers for fifteen years now.
seanalltogetheralmost 5 years ago
Is there a good reason that ^ is not used as an exponent operator in most (all?) languages. Its used in every calculator Ive seen.<p>2^5 = 32
评论 #24071599 未加载
评论 #24071582 未加载
评论 #24071591 未加载
tobralmost 5 years ago
Could someone edit the title? As it stands it could be about literally <i>any</i> two features of JavaScript.