ecmascript-6 Questions
31
Solved
I've done most of my research on this on BabelJS and on MDN (which has no information at all), but please feel free to tell me if I have not been careful enough in looking around for more informati...
Ashy asked 26/4, 2015 at 15:3
4
Solved
I want to reuse styles within StyleSheet.create's parameter object, how to do that?
See the code:
const styles = StyleSheet.create({
style1: {
color: "red",
backgroundColor: "white"
},
style...
Preprandial asked 2/10, 2019 at 7:47
4
Solved
Here is the code where I have included spread operator
style={{ ...styles.detailsRow.icon, alignSelf: 'centre' }}
What things do I need to install or add to make it run?
And also what is its...
Biz asked 20/7, 2016 at 21:3
5
Solved
I'm trying to display images in a shopping cart i'm making but its not showing up. Do i have to import each image? I know my paths are fine because it worked before.I think there might be something...
Shaynashayne asked 26/7, 2017 at 18:30
17
Solved
Is it possible to sort the entries of a es6 map object?
var map = new Map();
map.set('2-1', foo);
map.set('0-1', bar);
results in:
map.entries = {
0: {"2-1", foo },
1: {"0-1", bar }
}
Is it...
Appellation asked 1/7, 2015 at 10:34
5
Solved
I am running the command npx webpack-dev-server --mode development in my react application and getting the preceding error.
[webpack-cli] Invalid options object. Dev Server has been initialized usi...
Diapedesis asked 8/9, 2021 at 11:32
3
I'm confused regarding events not firing in a particular ES6 module loading scenario. Here is a Codepen project to support my examples:
https://codepen.io/fchristant/project/editor/AYQkGJ
Consider...
Reconstructive asked 5/5, 2020 at 11:38
8
Solved
I want to convert an instance class to plain object, without losing methods and/or inherited properties. So for example:
class Human {
height: number;
weight: number;
constructor() {
this.heig...
Sporran asked 9/1, 2016 at 22:12
8
According to this esdiscuss discussion, it is possible in ECMAScript 6 to define multiline strings without having to place subsequent lines of the string at the very beginning of the line.
Allen W...
Illumine asked 18/9, 2014 at 23:29
20
Is there a clean way to return a new object that omits certain properties that the original object contains without having to use something like lodash?
Lockyer asked 25/3, 2017 at 2:9
7
Solved
I have a Vue 2 project, and I've written a simple function for translating months in dates, which I would like to import in one of my components, but I'm getting an error:
export 'default' (impo...
Mishear asked 1/9, 2017 at 7:19
10
Solved
So I am trying to create a method that mimic exactly what the Array.prototype.map() method does and there is a lot I am confused about.
The main problem I suppose comes down to its syntax. I know ...
Dropsonde asked 19/6, 2019 at 5:46
11
Solved
I have a class written in Javascript ES6. When I try to execute nodemon command I always see this error TypeError: Class constructor Client cannot be invoked without 'new'
The full error is mention...
Eastsoutheast asked 15/8, 2018 at 13:51
8
Solved
I need to disable prettier for a single file (API URLs file) in my project in Vs-code. actually, I need each API and its URL to be in one line, but prettier breaks them in two lines.
before
export ...
Felicidad asked 23/1, 2020 at 10:42
6
Solved
I have been experimenting with ES6 classes and am wondering if you can change class names dynamically? For example
class [Some dynamic name] {};
Savoirfaire asked 9/11, 2015 at 9:14
14
Solved
Consider the following two files:
app.js
import Game from './game/game';
import React from 'react';
import ReactDOM from 'react-dom';
export default (absPath) => {
let gameElement = document...
Deathless asked 13/10, 2016 at 19:13
3
Solved
I am working on a ReactJS & Redux app. At some point, I have a list of elements (notes), each one of them having an array (subtasks). I would like to display all the elements, and for each of t...
Vagrant asked 4/3, 2018 at 9:58
19
Solved
How do you compare two javascript sets? I tried using == and === but both return false.
a = new Set([1,2,3]);
b = new Set([1,3,2]);
a == b; //=> false
a === b; //=> false
These two sets ar...
Carpo asked 30/6, 2015 at 3:4
3
I want to format a currency with NumberFormat of Intl and get the returned value with a space " " between the symbol and the number.
new Intl.NumberFormat('pt-br', { style: 'currency', cu...
Incantation asked 14/6, 2017 at 1:22
2
Solved
I have a handler like
handleSelect = (k0, k1, v) => {
...
}
};
And I want to make k1 here optional. Is there a good way?
Maduro asked 18/8, 2018 at 23:3
16
Solved
I am getting the following warning from my NextJS Application:
Warning: Extra attributes from the server: data-new-gr-c-s-check-loaded,data-gr-ext-installed,cz-shortcut-listen,data-lt-installed
I...
Waterscape asked 3/2, 2023 at 15:38
9
Solved
In ES6, how do we quickly get the element?
in MDN Syntax for Set, I didn't find an answer for it.
Tricornered asked 12/9, 2015 at 13:25
3
Solved
Help! I'm learning to love Javascript after programming in C# for quite a while but I'm stuck learning to love the iterable protocol!
Why did Javascript adopt a protocol that requires creating a n...
Hundredpercenter asked 22/12, 2018 at 9:52
4
Solved
How can I check if a value is Symbol in JS?
I do not see a Symbol.isSymbol(x) method. My test of (x instanceof Symbol) does not seem to work either.
Kosse asked 28/9, 2017 at 22:27
5
Solved
In ES6, is there any possible to clone an iterator states?
var ma=[1,2,3,4];
var it=ma[Symbol.iterator]();
it.next();
if I want to remember here the it states how should I do in javascritp?
wha...
Marilyn asked 26/9, 2017 at 0:57
© 2022 - 2024 — McMap. All rights reserved.