0

I would like to know which operators were added to Javascript most recently.

This includes any operators which might not have got all the way through the standards process to being implemented in all browsers, if it's more or less certain they will be.

If no new operators have been added very recently then I'd still like to know how long ago the last couple of new ones did make it in.

Since first asking this question half an hour ago, I've already learned that there are syntactic features of JavaScript that are commonly referred to as "operators" but that may not technically qualify as operators. In light of this I'd like this question to cover the broad sense of the term.

hippietrail
  • 15,848
  • 18
  • 99
  • 158
  • 1
    Just compare the [spec revisions](http://www.ecma-international.org/publications/standards/Ecma-262-arch.htm) against each other. What research have you done yet? – Bergi Jan 27 '16 at 04:28
  • 2
    What kind of syntax do you consider an "operator"? – Bergi Jan 27 '16 at 04:30
  • @Bergi: Only what EcmaScript officially consider to be operators. – hippietrail Jan 27 '16 at 04:31
  • You really ought to just go read one of the thousands of "What's new in ES6?" (or sometimes called ES2015) articles and then ask a much more specific question (if you need to) after reading. Here are a couple summaries of new things: https://babeljs.io/docs/learn-es2015/ and https://github.com/lukehoban/es6features – jfriend00 Jan 27 '16 at 04:37
  • I was only interested in operators and I was interested whether there were new ones in ES6 or whether the last new ones were years ago. – hippietrail Jan 27 '16 at 04:41
  • Close votes because the answer is so obvious? If so why do the two answers no agree? Do the differences not even deserve elaboration? – hippietrail Jan 27 '16 at 04:43
  • Well now that it's clear not everybody has the same understanding of what is an operator in JS I'm increasingly unsure about my answer in my first comment. \-: Please allow me to tweak my question now that you've helped me see what could technically be misuse of the term "operator". – hippietrail Jan 27 '16 at 04:47
  • 1
    @hippietrail: "*What is an operator?*" would probably make a much better (although slightly opinion-based) question than this. – Bergi Jan 27 '16 at 04:49
  • Well that would be a whole separate question. I'm still interested in the development of the set of "operators" in JS. – hippietrail Jan 27 '16 at 04:50
  • @Bergi: OK I've taken your advice and also asked a new question on clarification of this term: http://stackoverflow.com/questions/35029217 – hippietrail Jan 27 '16 at 04:59

2 Answers2

2

Considering ES6 as the latest standard, the "newest" operators are the strict equality and non-equality operators (===, !==) that were introduced with ES3. Later revisions of the standard added new syntax, but none of them did bring new operators.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
  • 1
    Hmm so is es6-features.org wrong to describe the spread operator and iteration & for-of operators as such? – hippietrail Jan 27 '16 at 04:43
  • 2
    Hm, the spread operator is nicknamed as such often, because it looks like a unary operator, but technically it's only an extension of the array literal / function argument list syntax. It's not a stand-alone operator that makes an expression, and cannot be "applied" anywhere. `for of` definitely is a statement, not an operator. – Bergi Jan 27 '16 at 04:46
  • You'll also be interested in [this thread](http://stackoverflow.com/q/35019557/1048572) that lines out how spread would be expected to work as an operator… – Bergi Jan 27 '16 at 14:08
-2

Well there are some in EcmaScript 6 that I wasn't even aware of until I wondered this and started looking for an answer.

The "spread operator": ...


The site es6-features.org "ES6 ECMAScript 6 — New Features: Overview & Comparison" also lists an "Iterator & For-Of Operator".


I'm just reading up on these now myself so forgive me for not including brief descriptions just yet ...

hippietrail
  • 15,848
  • 18
  • 99
  • 158
  • Neither `...` spread syntax nor `for of` loops are considered *operators* by ES6. – Bergi Jan 27 '16 at 04:43
  • Confusing. Seems like all the more reason to take this opportunity to say something clear about the actual situation. – hippietrail Jan 27 '16 at 04:44
  • 1
    @Bergi—today I discovered that the [*Introduction* to ECMAScript 2018](http://ecma-international.org/ecma-262/9.0/#sec-intro) includes "*It also includes rest parameter and spread operator support…*". In the normative part it's called [*SpreadElement*](http://ecma-international.org/ecma-262/9.0/#prod-SpreadElement). Just sayin'. :-) – RobG Oct 19 '18 at 06:04