Questions tagged [es6]
ECMAScript 2015, standardized as ECMA-262 6th Edition
31 questions
1 vote
0 answers
227 views
What is a forged redirect? (in the context of javascript's fetch API)
I'm trying to make sense of the docs located at: https://developer.mozilla.org/en-US/docs/Web/API/Response/redirected It says Note: Relying on redirected to filter out redirects makes it easy for a ...
13 votes
3 answers
14k views
How does JS Promises works being single threaded
Javascript is single threaded. What I understand from this is if JS i executing on line of code lets say a function. It cannot go to the next line unless that function has been removed from the stack. ...
0 votes
1 answer
919 views
Is it okay to use var on purpose in ES6, as opposed to let?
I was really glad that ES6 introduced the let keyword for defining variables. var scoping rules can lead to all kinds of issues, especially when working with loops and event handlers. Even when ...
2 votes
0 answers
166 views
Is there an accepted Coding Style for multiple ES6 Arrow Functions?
I'm starting to use ES6 arrow functions more, but haven't found a coding style that I like, especially when chaining them together. e.g., Eric Elliott gives this code: mix = (...fns) => x => ...
0 votes
1 answer
148 views
Simple algorithm for computing an orderable value from a string
I would like to compute a numeric value for strings containing only /[a-z0-9]/i (ignore case). Later, I want to use this value for sorting rows. For this post, I am ignoring number also. My thinking ...
2 votes
1 answer
112 views
Convention where to place unexportable functions
For the example's sake let's say there is a given file math.js. Think of it as a module containing many reusable functions. The content of file is: export function area(shape) { normalize(shape) ...
1 vote
0 answers
395 views
SystemJS Transpiler - where would it be used
I'm creating a project which uses SystemJS/JSPM. I'm also using TypeScript. Now TypeScript has the option of compiling JS using SystemJS Modules - which I'm doing and all is good. I've created TS ...
2 votes
2 answers
3k views
How to 'read' arrow functions in ES6?
I've been trying to learn some of the new features of ES6, and while most of it makes sense, I'm having trouble grasping the arrow function. I'm not asking so much why it exists as I am how to read it....