Questions tagged as 'ecmascript-6'

2
answers

Ajax request in ES6 constructor

How do I make a Ajax request in my constructor and assign the values of this request to my attributes? So far it's like this and it's not working, I'm returning 2 jsons ... on console.log the attributes are empty, ie the...
asked by 01.05.2017 / 04:32
2
answers

I need help with this code ES6

I'm trying to get the data that's coming this way: [ { "name":"JONAS", "languages":["php","javascript","java"], "age":37, "graduate_date":1044064800000, "phone":"32-987-543" }, { "nam...
asked by 19.11.2018 / 03:07
1
answer

How to use Methods from an Extends Class?

   I have two classes: A and B       Class B looks like this: B extends A       I need to use some methods that has within Class   A ,    in class B . How do I do it? class NeorisMapBi { constructor(mapID, mapOBJ){...
asked by 19.01.2018 / 05:08
1
answer

Is it possible to use addEventListner in this way?

I'm studying javascript and decided to play around with the creation of fields with DOM CORE . This is the code I've done so far: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name=...
asked by 11.12.2017 / 01:40
1
answer

Which framework do you recommend for unit testing in javascript (ECMAScript 6)?

I will develop a web application using ECMAScript 6. I would like to continue with the TDD Technique. What framework do you recommend for unit testing in javascript (ECMAScript 6)?     
asked by 16.06.2017 / 21:23
1
answer

Integrate ES2015 Classes with jQuery

After a lot of reading I finally managed to make Babel work and thus transpile the scripts. Before using das, let's call it ES2015 classes, after reading about best practices I had something like this: ( function( Navigation, window, do...
asked by 10.01.2017 / 14:32
1
answer

How to use function parameter as an attribute of an object?

Hello! In order to reuse a function I'm doing the following: View 1 has this object: obj: [ {"fruta": "maça", "valor1":1}, {"fruta": "banana", "valor1":1}, {"fruta": "pera", "valor1":1} ] View 2 has this object: obj: [ {...
asked by 10.10.2018 / 18:09
1
answer

Passing information between components without ReactJS hierarchy

How to pass information between components in React as props or status. In this situation I have a button and a menu. The menu must be opened every time the button is clicked. Button import React, { Component } from 'react'; import './Na...
asked by 21.08.2018 / 12:50
2
answers

Using the filter method an array of objects

I have an array of objects: const musicData = [ { artist: 'Adele', name: '25', sales: 1731000 }, { artist: 'Drake', name: 'Views', sales: 1608000 }, { artist: 'Beyonce', name: 'Lemonade', sales: 1554000 }, { artist: 'Chris Stap...
asked by 11.03.2018 / 02:51
1
answer

How to identify the child element clicked through the click event on the parent element

I have the following code: <div class="tipo-cadastro"> <div class="box-logista active">Logista</div> <div class="box-distribuidor">Distribuidor</div> </div> and the following code in javascript /...
asked by 01.02.2017 / 18:31