ecmascript-next Questions
2
Solved
Are private getters/setters planned to be supported in JavaScript?
class Next {
#private = 0
get #computed() { // SyntaxError: Unexpected token (
return this.#private + 1
}
}
...
Missi asked 26/4, 2019 at 11:4
2
Solved
I'm trying to do something like this:
gulp.task("test", async () => {
return gulp.src("**/*.scss")
.pipe(print((filePath) => `File: ${filePath}`));
});
(print is gulp-print)
But it give...
Swayback asked 9/12, 2015 at 20:24
2
Solved
I tried to write ternary operator with spread syntax and copy two objects. Is it possible to use ternary operator with spread syntax inside with literal objects? My code works okay, I just want to ...
Aerial asked 19/7, 2017 at 8:13
3
I've found supportedLocalesOf, but is there a way to get all supported locales, not just check which among a given list are supported?
The '*' tag option described in this 2012 post no longer work...
Bisector asked 28/9, 2018 at 6:29
3
Solved
Here is my tsconfig.json file:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"so...
Lemuel asked 4/5, 2020 at 12:58
7
Why do I keep getting this error when trying to run my Node.js/Express server?
Is this a part of the newer ES7? What do I need to be able to run an app using these new features?
Bedroll asked 8/5, 2017 at 23:27
4
Solved
I'm looking at the stage 3 proposal of Object.values/Object.entries and I'd really like to use it in my current JavaScript project.
However, I can't figure out whether there's any Babel preset whi...
Grovel asked 29/1, 2016 at 17:8
5
Solved
I read that async functions marked by the async keyword implicitly return a promise:
async function getVal(){
return await doSomethingAync();
}
var ret = getVal();
console.log(ret);
but that i...
Multiversity asked 9/2, 2016 at 21:22
1
Is there a mapping somewhere from Node.js version, e.g. 0.10, or 14, to the corresponding ECMAScript version, e.g. ES5, ES2020?
As this question is closed, I can't post the solution I came u...
Facility asked 26/10, 2020 at 22:39
3
Solved
Does eslint have any ability to warn about places to prevent Unhandled-Promise-Rejections?
Unhandled promise rejections are deprecated. In the future, promise
rejections that are not handled will ...
Nicobarese asked 24/7, 2020 at 8:0
1
Solved
class Foo {
static v = 123;
static bar = () => this.v;
}
console.log(Foo.bar());
I expect this code to return undefined, because arrow functions are lexically scoped, hence this mu...
Selfconsequence asked 17/9, 2020 at 12:3
4
Solved
Assume we have array of objects.
Calling Object.assign(...array) makes an inheritance among those objects where object with index i override existing properties in object with index i-1
For exam...
Neurosis asked 16/8, 2016 at 22:47
2
Solved
String.raw can be used to create a string that contains backslashes, without having to double up those backslashes.
Historically, you'd need to double up backslashes when creating a string:
...
Locomotive asked 24/4, 2020 at 20:22
1
Solved
I had an if statement in code which checks whether an object is defined and then check for equality for one of its properties. My if statement was like:
if(obj && obj.a !== x) { // do somet...
Sumba asked 26/6, 2020 at 22:13
1
Please help me to rewrite the code to use the dynamic import feature.
Unfortunately i have no idea how to use dynamic import in module.
import firebase from 'firebase/app';
import 'firebase/firest...
Bustamante asked 29/5, 2018 at 15:54
2
Solved
Other than just guessing (like I've done below), is there a more direct and efficient way of reflectively retrieving a list of all currencies supported by your JavaScript environment?
function ...
Grace asked 20/9, 2019 at 13:28
2
Solved
I looked at HostPromiseRejectionTracker in the ECMAScript specification, but still did not understand what it was doing. It does not have specific steps of the algorithm, so it is not clear how thi...
Glidewell asked 18/11, 2019 at 3:10
2
I work on a project where we use optional chaining operator (aka Elvis operator):
const baz = new obj?.foo?.bar?.baz()
Is it a way to make WebStorm understand it?
P.S. It's a part of stage-1 pr...
Oblong asked 24/8, 2017 at 13:44
2
ERROR in multi axios font-awesome history material-ui prop-types react react-bootstrap react-dom react-foundation react-redux react-router react-router-dom recharts redux redux-saga
Module not f...
Mussorgsky asked 29/12, 2017 at 3:8
3
Solved
I am getting this Error when running the following code
let foo = ' foo '
console.log(foo.trimLeft())
//foo.trimStart() works neither
I know most of the solutions in the internet say, that I hav...
Upi asked 30/1, 2019 at 10:24
3
Solved
I was reading about JavaScript classes, and came across this term "public class fields syntax". On digging a bit deeper into it I came across this Babel's documentation on class properties.
Can so...
Outdare asked 22/8, 2019 at 11:40
2
Solved
I was wondering if there is a way, to destructe and use an array method at the same time? If yes, is it useful to use it, or would it decrease the code readabilty so much, that it's not worth it?
...
Landry asked 30/3, 2018 at 9:39
6
Solved
I'm looking for a pure function, to modify my immutable state object. The original state given as parameter must stay untouched. This is especially useful when working with frameworks like Redux an...
Debussy asked 11/4, 2016 at 15:36
2
Solved
I have following code, fileStatsPromises is of Promise<Stats>[], both foo and bar are Promise<Stats>[]. What is the correct way to await them? I want to get <Stats>[].
const fil...
Ambidexterity asked 21/5, 2016 at 8:23
1
How could I implement a decorator that makes all methods of a class automatically chainable?
I have the following class:
class MyClass {
async foo() { console.log(1); }
async bar() { console.lo...
Berube asked 19/2, 2019 at 1:58
© 2022 - 2024 — McMap. All rights reserved.