Use this tag for questions about features finalized in ECMAScript 2017. Do *not* use this tag if the code in question merely *uses* one of the features, *unless* the feature is cause of the problem.
I'm using version 4.3.5 of typescript with Ionic and have ts(1378) error.
Here are is the tsconfig:
{
"compilerOptions": {
"target": "es2017",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"sourceMap": true,
…
Given the following two objects:
let a = { foo: 'bar' };
let b = {
one: 1,
two: 2,
three: 3,
four: 4,
five: 5,
six: 6,
seven: 7
};
We can assume that all values within these objects are primitives. The goal is to copy some attributes…
Can I solve the following with a single regex? I know it can be done with two separate regex, but I'm curious if it can be done with just one instead?
Find all instances of words (variables) that begin with $_, but only when they fall anywhere…
I have tried Wild Web Plugin and it still shows "Semi-colon expected" at the codes that use async.
Wild Web Plugin claims that it handles ES2018 (https://marketplace.eclipse.org/content/wild-web-developer-web-development-eclipse-ide), but it's not…
Angular 8 :
I used to use as a short hack on typescript side :
object['accessor']['accessor']['accessor']
to get
object.accessor.accessor.accessor
without running the risk of throwing an error if one of the children was empty.
What is the best way…
When I'm going to compile my code with gulp
displays the following error (image highlighted).
It follows the function of the 1685 line that uses async in angular cli.
$scope.GetNomePacienteIndicou = async function(chave_indicacao){
…
When tsconfig.json has the following
"target": "es5",
"lib": [ "es6", "dom", "es2017" ]
it doesn't seem to convert es2017 constructs to es5. For instance, the following will fail on IE11:
var foo = [1, 2, 3].includes(1);
Is this by design or am I…
I've a simple class handling the readable stream of a Fetch response:
class ProgressIndicator {
constructor(res) {
this.res = res;
this.contentLength = parseInt(res.headers.get('content-length', 10));
this.loaded = 0;
return…
I have an array like this:
const peopleArray = [
{
"id": "Antoine",
"country": "France"
},
{
"id": "Alejandro",
"country": "Spain"
}
]
That I would like to represent as on object like this (note that…
Need to terminate POST function and send Error: something as response, without terminating program.
Sample for-loop:
for (let i = 0; i < req.body.listoftouristsbyid.length; i++) {
client.query("SELECT tourists.id FROM tourists WHERE tourists.id =…
It appears it does not work in Stackblitz, but can Object.values() be used in general in Angular projects?
IIUC Angular includes CoreJS and the purpose of it is to allow things like Object.values() to be available across all browsers?
An object is like:
const obj = [{name: 'Alex', age: 20}, {name: 'James', age: 22}];
This obect is immutable from Immutable.js.
Is it possible to add a new key for each object? example:
const obj = [{name: 'Alex', age: 20, city: 'New York'}, {name:…
I'm using the latest ES8 features in my react code, for example, async and await. Because of misconfiguration problem in my webpack config, I cannot use source maps, and this slows down debugging.
A quick solution could be to locally compile source…
I'd like to convert this Ember route action to use ES2017 async / await. Can someone please explain what this would look like?
Per spec, I already added: babel: { includePolyfill: true } to my ember-cli-build.js file:
save() {
let tenant =…
In ES5, Boolean.prototype is a Boolean object:
The Boolean prototype object is itself a Boolean object (its [[Class]] is "Boolean") whose value is false.
In ES6 / ES2015, it isn't:
The Boolean prototype object is an ordinary object. It is not a…