Skip to main content

Questions tagged [ecmascript]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
324 views

I am trying to wrap my head around what the ECMAScript specification suggests about variable assignment. Introduction: Coming from Java, this is pretty straight forward. Variables get stored at a ...
tweekz's user avatar
  • 237
0 votes
2 answers
548 views

Coming from languages like C++, Java or PHP I've learned that there are Value Types and Reference Types. Value Types store values directly in the variable (in a box / memory location). Whereas ...
tweekz's user avatar
  • 237
0 votes
2 answers
220 views

When reading through the ECMAScript specification, I noticed, it actually never mentions concepts like "pass by value" or "pass by reference". When looking at the assignment ...
tweekz's user avatar
  • 237
6 votes
2 answers
591 views

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 ...
Newb's user avatar
  • 178
3 votes
1 answer
584 views

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 ...
Hugh's user avatar
  • 141
2 votes
1 answer
96 views

I am writing a client to talk to a server API in JavaScript. I have an OOP background but am trying to embrace modern EcmaScript. So I started with this: customerApi.js: const baseUrl = "http://...
user210757's user avatar
0 votes
0 answers
154 views

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 ...
mfrachet's user avatar
  • 1,591
4 votes
2 answers
4k views

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 ...
dwjohnston's user avatar
  • 2,769
3 votes
1 answer
851 views

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 ...
Manish M Demblani's user avatar
1 vote
1 answer
94 views

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, ...
nicholaswmin's user avatar
  • 2,134
1 vote
2 answers
104 views

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: ...
David Poxon's user avatar
0 votes
1 answer
1k views

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 ...
Dimitrios Desyllas's user avatar
3 votes
1 answer
604 views

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 ...
ibi0tux's user avatar
  • 241
26 votes
1 answer
4k views

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 * ...
Pete's user avatar
  • 1,247
16 votes
3 answers
5k views

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 ...
callum's user avatar
  • 10.5k
0 votes
0 answers
267 views

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 ...
tt9's user avatar
  • 631
1 vote
1 answer
325 views

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 ...
ZomoXYZ's user avatar
  • 113
6 votes
1 answer
2k views

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 [[...
overexchange's user avatar
  • 2,325
6 votes
1 answer
453 views

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 ...
J.Todd's user avatar
  • 3,833
0 votes
1 answer
320 views

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 ...
FredyC's user avatar
  • 111
49 votes
3 answers
32k views

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 ...
callum's user avatar
  • 10.5k
8 votes
1 answer
343 views

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 ...
Casey's user avatar
  • 189
1 vote
1 answer
489 views

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 ...
Doug T.'s user avatar
  • 11.7k
5 votes
2 answers
484 views

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 ...
Niklas Rosencrantz's user avatar
3 votes
1 answer
627 views

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 ...
Laurent Bourgault-Roy's user avatar
0 votes
1 answer
931 views

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. ...
AverageMarcus's user avatar
4 votes
1 answer
479 views

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 ...
user697296's user avatar
98 votes
2 answers
7k views

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 ...
Lord Loh.'s user avatar
  • 1,787
9 votes
3 answers
1k views

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, ...
futlib's user avatar
  • 2,205
14 votes
5 answers
7k views

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: ...
Jose Faeti's user avatar
  • 2,815