Questions tagged as 'es6'

2
answers

context this in function arrow with prototype

In the following example I have a class and add two functions by prototype the first as defined by funcion normalmente , while the second with arrow function simpleClase = function(){ this.ejemplo = 1 } simpleClas...
asked by 02.02.2018 / 02:51
1
answer

extended classes in javascript with ecmascript6

I have a base class ( Persona , which implements some methods and in its constructor accepts parameters. is the following class Persona { constructor (nombre, apellido) { this.nombre = nombre; this.apellido = apel...
asked by 05.03.2017 / 16:28
1
answer

this.state.users.map is not a function

Trying to show data in a view in React Js , I have found an error that following the steps of the tutorial still persists:    this.state.users.map is not a function The code is as follows import React, {Component} from 'react'; im...
asked by 23.02.2018 / 19:11
1
answer

predefined iterables: implications with the length property and the access operator []

I was wondering if all the iterables predefined in JavaScript that have the property .length , can access their elements via operator [<indice numérico>] and vice versa? Array -> '.length' & operador '[]' String ->...
asked by 18.05.2017 / 19:57
2
answers

Get the value of a promise

I'm having a lot of trouble getting the value of a promise . Basically I want the value that returns a promise to be assigned to a variable. For example    This example uses the following elements: vue. js , vuex , almacen is a syno...
asked by 27.03.2017 / 04:06
1
answer

How to add a new item within an array property in an object?

Hi, I'm trying to use the for in function to find the name of an array-like property that I have inside an object and if there is an item stored inside the property. But the problem is that it is saving the item in all the arrays and what I want...
asked by 15.03.2018 / 23:04
1
answer

Manipulate DOM with Object Oriented Programming

I am trying to implement the OOP to manipulate the DOM but there are certain things that I do not know where to place, for example the addEventListeners, a specific case that I am facing is, I have created an object that works with some elements...
asked by 31.01.2018 / 03:55
4
answers

Error in ES6: "is not a function"

How to call a method (from another) that are in the same class in NodeJS? class Usuario{ static foo(){ let a = this.bar(); } bar(){ return true; } } Usuario.foo(); I...
asked by 10.04.2017 / 22:36
2
answers

Using Object.assign for a multi-level javascript object

Well I am doing a React-Readux application, and I have the following Array of objects that my store has: const authors = [ { id: 'cory-house', firstName: 'Cory', lastName: 'House', address: { city: 'Caracas' } },...
asked by 02.08.2017 / 01:16
1
answer

why assign the same name to both a variable and a function?

const Hola = function Hola() { _classCallCheck(this, Hola); };     
asked by 27.01.2018 / 09:26