ecmascript-6 Questions
2
Solved
Safari has support for ES6 Maps and Sets in version 7.1 and higher (MDN).
I'm using a Map in my application and at some point want access to the values. Calling the values() function on the map see...
Verbid asked 16/4, 2015 at 8:54
2
Recently I have come across about globalThis in Javascript. I am not sure how it is going to behave if it is called from a function. Every time it is returning the window object. if that is the cas...
Popover asked 23/7, 2019 at 6:26
7
just upgraded from ng8 to ng11.
when I run ng serve it works fine, but when I run build for production I get the following error:
Generating ES5 bundles for differential loading...
An unhandled ex...
Exocrine asked 18/3, 2021 at 23:52
9
Solved
In ES6, we can do:
const key = "foo"
const myObj = { key }
myObj
// => { foo: "foo" }
So, { key } is equivalent with { key: key }.
But, how can we create the same object without having the k...
Kalasky asked 22/8, 2017 at 14:2
3
Solved
I have a ts module. I'm compiling this module to another project's specific folder by using outDir of tsconfig.json and the command tsc -w. So, whenever I update the ts module, it compiles files to...
Carlock asked 21/4, 2021 at 12:9
3
I have a nodejs / typescript 2 project and use the es6-promise package.
Now i would like to get rid of the extra package because i can target ES6 in typescript directly.
So i removed the es6-pro...
Improvident asked 9/3, 2017 at 7:57
3
I am using Rollup to bundle my code for production.
I have multiple js files, so I am using the Rollup plugin-multi-entry plugin to use a glob pattern to target all of my js files.
I am outputting ...
Gerfen asked 1/10, 2020 at 14:2
6
Solved
I used grunt-uglify in my project and I'm working with es6. for some es6 features, such as fat arrow function, it's throwing an error. I think the uglify don't understant that syntax. so do i have ...
Tightlipped asked 18/7, 2016 at 6:5
3
Solved
I'm following a react tutorial but I'm lost. I don't understand starting line 9.
so I tried to make a little miarature
const updateTodo = (list, updated) => {
const index = list.findIndex(...
Falsework asked 5/2, 2017 at 14:25
3
I've faced the issue with the storybook library + ReactJS.
I need to display a custom text under the brand image in the storybook. Is there any option in the storybook library to achieve it?
Are we...
Kiwanis asked 19/3, 2021 at 12:52
4
I'm writing some tests in selenium webdriver js. I start by typing:
it('blah blah blah', async () => {
await driver
})
Then I type . after driver. Suggestions come up. Then I select findElem...
Delmydeloach asked 18/1, 2020 at 18:20
4
Solved
I would like to ask if how should I fix this issue because I am already stuck and confused about this part. I already installed rollup globally using this command
npm install --global rollup
Howev...
Raye asked 1/10, 2021 at 0:17
7
I am trying to use styled-jsx with some code. However, no matter what I do, I seem to get an error
index.js:1437 Warning: Received `true` for a non-boolean attribute `jsx`.
If you want to write i...
Fray asked 29/7, 2019 at 21:18
4
Solved
Is it possible to get the file name of the current JavaScript module?
// item.mjs
function printName() {
console.log(...); // >> item or item.mjs
};
If not, why not? Sandboxing, etc.
Bathhouse asked 26/8, 2019 at 19:22
3
Solved
I'm using Sequelize together with Node and JavaScript in one app. As you know when you execute sequelize-init it creates config, migrations, models and seeders folder. Inside of the models folder, ...
Statecraft asked 22/2, 2021 at 11:40
2
Is there any harm in updating the message of an Error object like this?
const err = new Error('bar');
...
err.message = `foo ${err.message}`;
My objective is to add some useful information to th...
Dufour asked 23/1, 2019 at 13:38
2
Solved
I am trying to toggle an aria tag between true and false when a button is clicked. I've tried several implementations which seem to do absolutely nothing. Below is what I am currently using which s...
Capp asked 8/11, 2021 at 19:11
6
I have an Express API server app and a React client app both implemented in TypeScript. I defined my data models using TypeScript interfaces, and I'm using those interfaces on both ends of the syst...
Osrock asked 1/6, 2017 at 2:10
2
I have an existing ESLint configuration with "ecmaVersion" set to "5" that I want to modify to allow the use of let and const which are ES6 features. There are mostly* supported in Internet Explore...
Inert asked 5/11, 2018 at 19:9
7
Solved
The standard way to use a React useState Hook is the following:
const [count, setCount] = useState(0);
However this const count variable is clearly going to be reassigned to a different primitiv...
Factor asked 14/11, 2019 at 15:12
12
Solved
I am exporting the following ES6 class from one module:
export class Thingy {
hello() {
console.log("A");
}
world() {
console.log("B");
}
}
And importing it from another module:
import {...
Olson asked 10/6, 2015 at 14:14
7
Solved
I reduced the issue to this example:
test.model.ts
export class A {
a: number;
}
export interface B {
b: number;
}
test.component.ts
import { Component, Input } from '@angular/core';
import...
Ariosto asked 28/11, 2016 at 10:9
4
Solved
export * form 'some-library'
export * from './myOverrides'
// error: [ts] Module 'some-module' has already
// exported a member named 'someFunc'.
// Consider explicitly re-exporting to resolve the ...
Tempered asked 22/12, 2016 at 23:24
11
Solved
Is there an elegant way to tell Harmony's slim arrow functions apart from regular functions and built-in functions?
The Harmony wiki states that:
Arrow functions are like built-in functions in ...
Archeology asked 29/1, 2015 at 18:45
6
Solved
type Foo = { [key: number]: string }
const foo: Foo = { 100: 'foo', 200: 'bar' }
const sizes: number[] = Object.keys(foo)
Gives me:
Type 'string[]' is not assignable to type 'number[]
Why d...
Botch asked 28/6, 2019 at 9:13
1 Next >
© 2022 - 2024 — McMap. All rights reserved.