Questions tagged as 'ecmascript-6'

0
answers

Error [Can not GET] when simulating my application with lite-server with typescript

I'm having an error while simulating my application in typescript, the error generated is: Cannot GET / My tsconfig.json file from my application is simple, it only contains the following settings: { "compilerOptions": { "tar...
asked by 18.11.2017 / 14:38
1
answer

Class attribute in constructor

I can access an attribute of the class within the scope of the constructor, however outside gives ' undefined ' constructor(errorAlert){ this._errorAlert = errorAlert; } If, for example, in the code above, I give% of the% in the parameter...
asked by 30.10.2017 / 17:59
2
answers

String # codePointAt or String # charCodeAt?

In ECMAScript 6 new methods similar to the String.fromCharCode() and String#charCodeAt() were added: String.fromCodePoint() and String#codePointAt() . What's the difference between them?     
asked by 18.01.2017 / 01:33
1
answer

Referencing a import dynamically

Below I'm defining some imports; import users from './user'; import securities from './security'; import softwares from './software'; I want to be able to access them in the course of my file, but I can only access them dynamically if I do...
asked by 12.02.2017 / 00:12
2
answers

What does the "=" operator mean?

I was seeing some solutions in JavaScript and in one case I saw this command line: return args.reduce((s, v) => s + v, 0); . But I do not know what the => operator means. What's his role?     
asked by 21.02.2016 / 01:09
0
answers

How to convert ES6 to ES5 in the Cordova through a hook?

The Cordova crosswalk plugin does not work on iOS, so iOS WebView remains native. The problem is that the native WebView (Safari) does not run ES6, but my project is written in ES6. I need a kind of recursive hook that converts all parts of m...
asked by 02.08.2016 / 04:41
2
answers

What is the difference between map () and lenght ()?

I was studying and this code appeared: var materials = [ 'Hydrogen', 'Helium', 'Lithium', 'Beryllium' ]; console.log(materials.map(material => material.length)); From what I understand, it scans the array and ret...
asked by 20.01.2018 / 17:21
1
answer

Load items 4 in 4 in a javascript loop

Personal I'm making a request in an API that returns me some events, but I need only 4 items to be displayed first, and if a "See More" button is clicked .. should appear 4 more items at a time .. I have the following code: jQuery.ajax({...
asked by 04.07.2018 / 22:25
2
answers

Is there any method for me to create page translations with Javascript or Typescript?

I would like to know if there is any method for me to create my own static page translations with Javascript.     
asked by 12.12.2017 / 02:23
1
answer

Onclick JavaScript Event

I'm testing Onclick on JS and I'm strange about a business, it works only when I paste it into the document.querySelector('.a').onclick = teste2(); console, or the first time I run / open the page. If I click on the element I'm catching,...
asked by 03.06.2018 / 05:22