Most voted "ecmascript-6" questions
This tag is NOT synonymous with [javascript] and [typescript] tags. Also NOT to be used when the doubt is about technical problems of use (difficulties) or third party libraries, it should be used only for doubts about the specifications of the sixth edition (ES6/Ecmascript® 2015).
Learn more…132 questions
Sort by count of
-
0
votes1
answer442
viewsEvents of jQuery Vs. Arrow functions?
When executing the following code: $("button").on("click", function(){ console.log("Meu valor é: " + $(this).val()); }); <script…
-
0
votes1
answer535
viewsOnclick Javascript event
I’m testing the Onclick on JS and I’m weirding a deal, it works only when I glue the console document.querySelector('.a').onclick = teste2(); , or the first time I run/open the page. If I click on…
-
0
votes1
answer83
viewsLoad 4-in-4 items into a javascript loop
I’m making a request on an API that returns some events, however I only need to display 4 items first, and if a "See More" button is clicked.. 4 more items should appear at a time.. I have the…
-
0
votes0
answers69
viewsReact Native Error
Could someone help me I received the following feedback Não esqueça de cancelar as notificações e agendar as notificações do dia seguinte quando o usuário terminar um quiz :thumbsup:. Você pode…
-
0
votes1
answer5078
viewsPass 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 should open every time the button is clicked. Knob import React, {…
-
0
votes1
answer91
viewsPrivate method in JAVASCRIPT class
How to define a private method in a class JavaScript in order to make the method msg_privada as private (not externally visible) without changing the rating pattern? The method msg_privada must be…
-
0
votes1
answer60
viewsHow to use function parameter as object attribute?
Hello! In order to reuse a function I am performing the following procedure: View 1 has this obj: obj: [ {"fruta": "maça", "valor1":1}, {"fruta": "banana", "valor1":1}, {"fruta": "pera", "valor1":1}…
-
0
votes2
answers262
viewsI need help with that ES6 code
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" }, { "name":"FLAVIO",…
-
0
votes2
answers166
viewsWhat defines the name of Arrow Function in React
I’m studying Reactjs, and in the course I’m doing the teacher varies between class and arrow function, my doubt is, where the name of Function comes from? Example: When we create a component in…
-
0
votes1
answer104
viewsHow can I fix this error? I want only gives <Text>{selectedValueState}</Text>
How can I fix this mistake? It occurs when I try to render the text with {selectedValueEstado}. When I do <Text>{selectedValueCidade}</Text> it’s quiet (I’m new, so I have no knowledge…
-
0
votes2
answers2088
viewsGroup repeated records into an array in javascript
I have a JS array with only two attributes, a state name and a city name. Example: var variavel = [{estado: 'São Paulo', cidade: 'Campinas'}, {estado: 'São Paulo', cidade: 'Santos'}, {estado: 'São…
-
0
votes1
answer42
viewsWhich Javascript framework would you recommend for dynamically creating DOM Object?
Which JS framework would prompt me to create HTML objects dynamically? For example: I need to create a "btn-example" class button that references the Google website link (by clicking, open the…
-
0
votes4
answers580
viewsReturn Asyncstorage value in a constant
I’ve been trying for some time to return an item stored in the Asyncstorage of React Active, but the return is always a Promise, but what I want is to make decisions with this return later, and be…
-
0
votes1
answer985
viewsConvert Javascript array to a Javascript object?
The array Javascript below is the result of a query Mysql: json-database.json [ { "id": 1, "node_name": "SP2 - Virtual Private Serve Product", "children_name": "Virtual Private Server CPU",…
-
0
votes1
answer41
viewsReplace values of an object based on Keys
I have an object with settings that return from a server in the following format: { "example-url": "http://examples.com", "example2-url": "${example-url}/examples", "example3-url":…
-
0
votes2
answers164
viewsHow to modify a Javascript object with the same keys as another array with numbers?
I have an object with 20 keys in total, each key is associated to a value but, value that does not matter for the moment for the answer. So is the object: var obj = { 1: ..., 2: ..., 3: ..., ...,…
-
0
votes1
answer50
viewsDoubt with exercise of Ecmascript 6
This Ecmascript exercise talks about the creation of two classes, one of user (where the email and password will be entered), the other of administrator (where in addition to the email and password…
-
0
votes1
answer37
viewsHow can I make this calculation be performed in all the Objects of the array and return me the value multiplied by the length of the table?
I need the calculation to be performed in all Bjects before returning the value to me by the length of the table (OBS: it’s just a challenge I’m participating, I’m not using database). function…
-
0
votes1
answer49
viewsDeploy Node application in Heroku with ES6 modules?
Speak, devs! Following... I would like to know how to deploy a Nodejs application using ES6 Modules In my package.json I am using so: "type": "module", ... "scripts": { "test": "echo \"Error: no…
-
0
votes1
answer33
viewsAverage calculation returning Undefined when no Arguments is passed
(function(){ console.log(media()) function media() { let total = 0 let qtd = arguments.length for(i = 0; i < qtd; i++) { if(typeof arguments[i] !== "number") { return "Digite valores Validos" }…
-
0
votes0
answers27
viewsES6 package only works on first load - webpack
I built a package based on CSS3 / CSS4, HTML5 and its Apis, the package contains 101 files and uses promises to differentiate the files and measure its priority, at the end of a promise, you may or…
-
0
votes1
answer47
viewsJavascript recursiveness
Save, I started reading the book "Javascript Eloquent" and in the chapter on higher order functions I came across the following example of a code that calculates the genes that an individual…
-
0
votes1
answer32
viewsRemove list item
How do I remove the item from the list that is generated after the event that creates it? I am trying to place an event that has the function of removing the item, but when I run the code it turns…
-
0
votes0
answers16
views--findRelatedTests does not work
I’m trying to use the --findRelatedTests to run pre-commit tests using lint-staged, but the following error always happens The --findRelatedTests option requires file paths to be specified. Example…
-
-1
votes1
answer323
viewsObfuscate JS Code ES6
What is the most appropriate way to obfuscate code created using JS ES6 for use within electronjs?
-
-1
votes2
answers412
viewsJavascript: How to pick up an array of objects within a child of an array of objects
I have the following example object: const empresa = { nome: 'Tal tal', endereco: 'taltaltal', groupos: [ { nome: 'taltaltal', codenome: 'tal', as: [ { nome: 'grupo a', apelido: 'ga' }, { nome:…
-
-1
votes2
answers72
viewsHow to put Try/catch in ES6 format?
Code: this.boxes.forEach(box => document.body.removeChild(box) ); In ES5 it would be: this.boxes.forEach(function (box) { try { return document.body.removeChild(box); } catch(e){ //erros } });…
-
-1
votes1
answer79
viewsArray being rewritten completely within foreach
I’m running a voting system through the firestore, and I’m having a problem regarding the behavior of an array within the foreach, follow the code: busca_votos: function(pergunta){ let path =…
-
-1
votes1
answer48
viewsHow to use ES6+ Spread to metamorphosize one object within another?
I have the following object below: const usuario = { nome: 'Diego', idade: 23, endereco: { cidade: 'Rio do Sul', uf: 'SC', pais: 'Brasil', } }; I’m gonna create a usuario2 based on the object…
-
-1
votes1
answer41
viewsBABEL_PARSE_ERROR error using ES6 array
Hello! I am new using ES6, I did the installation of Babel, so when using array the Bundle accuses BABEL_PARSE_ERROR. It appears like this: Syntaxerror: C: xampp htdocs ES6 main.js: Unexpected token…
-
-2
votes2
answers303
viewsHow to assign the result of an object breakdown to a variable that contains all unstructured fields?
Given an object x: const x = { a: 1, b: 2, c: 3 }; and a breakdown: const { a, b } = x; How do I save these unstructured fields in an object that brings them together without having to: const y =…
-
-4
votes1
answer408
viewsWhat is the difference in the declaration of variables using const?
In the ecmascript-6 some features have been added, among them is the const the visa is used in the same way as the visa var, to declare variables. What is the difference between declared variables…