Questions tagged as 'ecmascript-6'

1
answer

Two click to change the item (slider)

I'm practicing a bit of JavaScript and trying to make the bases of a slider I ran into a problem. the problem is this: When I click on the previous or next arrows, the function is not executed at the first click as it happens when you sele...
asked by 28.10.2018 / 03:23
1
answer

Spread operator without mutating elements ES6

I have to create a function that creates a new array based on the previous two but without mutating them. function reverse(arr1, arr2) { const arr3 = [...arr2, ...arr1]; return arr3; } The problem is the following const arr1 = [1, 2];...
asked by 27.09.2018 / 22:50
0
answers

problem loading an HTML template with "fs" nodejs, inside an ES6 class

SOLVED: The problem was that webpack changes the default behavior of __dirname and you have to configure it so that the routes work for me. I added this: context: __dirname, node:{ __dirname: true //The "dirname" of the input...
asked by 10.04.2018 / 15:58
2
answers

Declared functions vs Expressed functions

I have a question about this: According to what I have read, the declared functions are available for your call regardless of their position in the code. Even if the declaration is at the end of a whole source code, it will take precedence...
asked by 07.08.2018 / 21:39
1
answer

Differences and advantages: Set and Map against Array and Object

Reading about ES6 and its characteristics, I wonder about: What is the advantage of Map against an Object ? What is the advantage of Set against an Array ? I understand that both are for data collections, but why not use the primi...
asked by 10.12.2018 / 23:31
1
answer

How to make an AJAX request to php? (With JavaScript Vanilla)

I'm trying to make an AJAX request to a method in my Brands driver. const filter = () => { let data = {marca:"a"}; fetch("www.algoalgo.com/marcas/marcas/filtro",{ method: "POST", body: JSON.stringify(data) , headers: { "...
asked by 23.08.2018 / 17:11
3
answers

How do I get an array with numbers and letters and a space to add up and form a word?

The exercise would be like this: const array_A = ["H",3,"o",4,"l",5,"a",6," ",7,"M",8,"u",9,"n",10,"d",11,"o"] const array_B = ["s",1,"t",2,"a",3,"c",4,"k"] const array_C = ["o",1,"v",2,"e",-3,"r","f","l","o","w"] You would have to see th...
asked by 16.10.2018 / 18:43
1
answer

How do I make it from the 2nd click and find the active class, delete it

How do I make it from the 2nd click and find the class active , delete it $('.siniestros button').click(function () { $('.siniestros>button>.before').addClass('active'); $('.siniestros>.preguntas').slideToggle('fast',f...
asked by 18.04.2018 / 00:43
2
answers

Insert element type date in an array every determined number of elements

I'm trying to insert a string which is a date every 5 elements that are generated dynamically. const utils = require('./utils'); const moment = require('moment'); const flatpickr = require('flatpickr'); const Spanish = require('flatpi...
asked by 08.12.2018 / 01:42
0
answers

Neo4j Movies Example Application - Node.js neo4j-driver

I'm trying to make the example neo4j-examples / movies-javascript-bolt for node.js. Making the appropriate pre-settings, when I launch the app with, $ npm run dev I get the following error, > [email protected] dev C:...
asked by 02.11.2018 / 02:57