Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ecmascript]

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

0
votes
0answers
14 views

Promise, Ecmascript and Whatwg event loop

I've recently learned that setTimeout is not part of Ecma 262 standard but takes part of WhatWG one. I have one misunderstanding concerning these two standards and I can't get how they converge. For ...
1
vote
2answers
119 views

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 ...
3
votes
1answer
288 views

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 ...
1
vote
1answer
61 views

Accessing properties of composited classes without breaking encapsulation

We've built a class that allows you to easily draw stuff on a <canvas> element. That class is called Canvas. I've encapsulated the <canvas> element and the class itself in a WebComponent, ...
0
votes
2answers
51 views

Literal assignment in ECMAScript 2017 Specification

I am trying to build a derivation tree for the program x = 42 using the specification for ECMAScript 2017. I see that there there is an AssignmentExpression which has the production rule: ...
0
votes
1answer
249 views

ES6 and OO Desighn: It is good idea to use a class as “Interface”?

Usually on Php or in Java and in other single Inheritance Object Oriented Languages, when I am writing a software I use and Interface then and afterwards I implement the class that implements the ...
3
votes
1answer
270 views

Javascript / Ecmascript language grammar disambiguation

I'm working on the design of a compiler for a language in which I have to use curly brace for two different purposes. I am currently stuck in writing a non-ambiguous grammar but I realized that some ...
14
votes
1answer
1k views

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 * ...
2
votes
1answer
650 views

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 ...
0
votes
0answers
191 views

Why doesn't Object.prototype.toString produce more meaningful output?

Why doesn't Object.prototype.toString return a string representation of an object? I don't see any use for the current output and it seems that it would be more useful for the toString function to be ...
1
vote
1answer
298 views

Template Literals (ECMAScript 2015 6th edition), are they worth it?

I recently found out about JavaScript's Template Literals, and they help a lot with readability. But would it be worth changing my code from now on to these Template Literals, or should I keep using ...
5
votes
1answer
619 views

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 [[...
5
votes
1answer
381 views

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 ...
0
votes
1answer
306 views

Switching over to the real ES6 / ES2015 [closed]

It is exciting time of having Babel and being able to use all nice nice features. It got me thinking, what happens in the future? Nobody really talks about it. I mean some browsers would eventually ...
29
votes
2answers
16k views

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 ...
8
votes
1answer
296 views

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 ...
1
vote
1answer
392 views

Does ES6 help grow the Ecmascript standard library?

With all the noise about EC6, one thing that I realized I haven't heard about is expanding Javascript's standard library. Javascript has a fairly sparse standard library. You need a 3rd party library ...
5
votes
2answers
416 views

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

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 ...
2
votes
1answer
499 views

Could it be possible to add the integer type to the ECMAScript standard?

In JavaScript, every number you will ever use will always be represented with what C programmer would call a double. The official type is I believe number. If I recall correctly, that fact was ...
0
votes
1answer
609 views

In what way is JavaScript (ECMAScript) similar to Self and Scheme

When looking at the ECMAScript 4th Edition specification here it mentions that ES3 is a simple, highly dynamic, object-based language that takes its major ideas from the languages Self and Scheme. ...
4
votes
1answer
462 views

what will EcmaScript 6 bring to the table for us [closed]

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 ...
93
votes
2answers
7k views

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 ...
9
votes
3answers
1k views

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, ...
14
votes
5answers
6k views

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

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: ...