Questions tagged [ecmascript]

ECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262.

ECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262.

30 questions
99
votes
2 answers

What is JavaScript, really?

All this started when I was looking for a way to test my webpage for JavaScript conformance like the W3C HTML Validator. I have not found one yet. So let me know if you know of any... I looked for the official JavaScript page and find ECMA Script.…
Lord Loh.
  • 1,767
  • 1
  • 14
  • 22
50
votes
3 answers

Any point in using ES6 Map when keys are all strings?

Plain object keys must be strings, whereas a Map can have keys of any type. But I have little use for this in practice. In nearly all cases, I find myself using strings as keys anyway. And presumably new Map() is slower than {}. So is there any…
callum
  • 10,377
  • 9
  • 30
  • 33
26
votes
1 answer

Are generator functions valid in functional programming?

The questions are: Do generators break the functional programming paradigm? Why or why not? If yes, can generators be used in functional programming and how? Consider the following: function * downCounter(maxValue) { yield maxValue; yield *…
Pete
  • 1,257
  • 12
  • 15
14
votes
3 answers

Why can't an ES2015 WeakMap have primitive keys?

There are six primitive data types in JavaScript: Boolean, Number, String, Symbol, undefined, null A WeakMap can't have primitive data types as keys. And a WeakSet can't have primitive values. Why is this? Is it a language design decision (in which…
callum
  • 10,377
  • 9
  • 30
  • 33
14
votes
5 answers

Why is JavaScript not used for classical application development (compiled software)?

During my years of web development with JavaScript, I come to the conclusion that it's an incredible powerful language, and you can do amazing things with it. It offers a rich set of features, like: Dynamic typing First-class functions Nested…
9
votes
3 answers

Does it make sense to use jQuery in modern-webkit-only web applications?

I'm lately working on a few mobile web apps for Android (2.3+) and iOS (4+). Their browsers support most of ECMAScript5, which is very powerful, and I wanted to use language features where possible, resorting to jQuery only when I had to. Turns out…
futlib
  • 2,107
  • 3
  • 21
  • 26
8
votes
1 answer

Why create a Global-ish Object.create function?

I'm a fairly experienced programmer in the .NET and Java realms, and I've started reading up on JavaScript. I bought Douglas Crockford's "The Good Parts" book, and I'm immediately put off by a few things. One is modifying the fundamental types…
Casey
  • 189
  • 2
6
votes
2 answers

Is "this" in JavaScript out of fashion?

I'm not a frontend dev, but I recall that a few years ago, the this keyword was commonplace in frontend codebases. In recent years, I haven't seen this get used anymore. In the last few frontend codebases I've worked on, I haven't seen it get…
6
votes
1 answer

Why is Array.prototype designed to be a fully functional array?

In the below visualisation, There are two array objects(cars & bikes) that are created with below syntax, var cars = new Array("Saab", "Volvo", "BMW"); var bikes = ["Honda", "Yamaha"]; whose [[Class]] property value is Array. In addition, we also…
overexchange
  • 2,245
  • 2
  • 17
  • 47
6
votes
1 answer

Will ECMAScript add classes to JavaScript? What does this mean?

I heard that some sort of class system will be added to JavaScript with ECMAScript and I find that a little confusing, because I've just finished reading a JS book, JavaScript, The Good Parts by Douglas Crockford, where he explained that the lack of…
J.Todd
  • 3,833
  • 5
  • 22
  • 27
5
votes
2 answers

Is there a name for the number of values a variable can take?

For example, a bit or a boolean can be either 0 or 1 so the number 2 is associated with it. Similarly, for a byte which is 8 bits, the maximum number of different assignments would be 2^8. Is there a name for this number? When we pass everything…
Niklas Rosencrantz
  • 8,008
  • 17
  • 56
  • 95
4
votes
2 answers

Is it conventional to use both await and .then()?

I've written a bit of code that looks like this: async function fetchData() { const json = await fetch(ENDPOINT + key.key).then(data => data.json()); //Do something with the data } It's pretty clear and straight forward what I'm doing…
dwjohnston
  • 2,543
  • 6
  • 29
  • 49
4
votes
1 answer

what will EcmaScript 6 bring to the table for us

Our company ported moderate chunks of business logic to JavaScript. We compile the code with a minifier, which further improves performance. Since the language is dynamically typed, it lends itself well to obfuscation, which occurs as a byproduct of…
user697296
  • 67
  • 2
3
votes
1 answer

What is the role of ISO in the ECMAScript standardization process?

I've been told on StackOverflow this questions was off-topic so I'm asking here: From this webpage (ISO/IEC 22275:2018): This International Standard defines the ECMAScript Specification Suite containing the ECMAScript programming language and its…
Hugh
  • 141
  • 4
3
votes
1 answer

NodeJS (ES6): Design Pattern with bind usage

The question is related to the resolution of the this operator in Javascript classes. NodeJS now supports ES6 classes. The problem faced during this is that when a new instance of the class is created and assigned to a variable everything works…
1
2