Questions tagged as 'es6'

4
answers

How to make Javascript capitalize each element of an array?

I have this function and this for.. of but I can not get the days to be capitalized by console. What's wrong ??? Array.prototype.toUpperCase = function() { for (let i = 0; i < days.length; i++) { days[i] = days[i].charAt...
asked by 07.12.2017 / 17:20
0
answers

Problem when adding an object to an array in ES6 - this.listLogs.data [index] .push is not a function

Good morning, I am trying to add an object to an array, I leave the code for a better reference. The problem is that I get an error that the push function is not correct. Maybe I'm doing something in a bad way. Please your help or some clue how...
asked by 05.01.2018 / 21:56
0
answers

Refactor Javascript

I have to refactor a web app legacy. They use modules in this way: myApp = (function(){})(); I understand that in this way the module is used as a space name, since even to use another module they do this: myApp = (function(){ otroModulo....
asked by 01.12.2017 / 13:33
1
answer

Way to use literals and other ES6 enhancements and precompile them in rails 4

Do you know if there is any support for precompiling javascripts using literals and other improvements to ES6? I wanted to start using projects rails ES6 but when I precompile in production it fails me. Thanks     
asked by 18.08.2017 / 05:13
2
answers

How to pass the reference of a variable (io - Socket.io) to a class in JS [Node.js]?

I would like to know what is the correct way to pass the reference of the variable io to a class in Node.js I currently have the variable initialized in a file index.js : const io = require('socket.io').listen(9000) Reading some bl...
asked by 12.05.2017 / 05:30