Top "Arrow-functions" questions

Questions about the compact function syntax in ECMAScript2015 (ES6) called "arrow functions" because of their use of "=>".

Arrow Functions and This

I'm trying out ES6 and want to include a property inside my function like so var person = { name: "jason", shout: () =&…

javascript this ecmascript-6 arrow-functions
Immediate function using JavaScript ES6 arrow functions

Does anyone know how to write an immediate function using ES6 arrow syntax? Here's the ES3/5 way of doing it: (…

javascript function ecmascript-6 ecmascript-harmony arrow-functions
What are the differences (if any) between ES6 arrow functions and functions bound with Function.prototype.bind?

It seems to me that, in ES6, the following two functions are very nearly identical: function () { return this; }.bind(this); () =&…

javascript ecmascript-6 arrow-functions function-binding
How to avoid bind or inline arrow functions inside render method

We should avoid method binding inside render because during re-rendering it will create the new methods instead of using the …

javascript reactjs arrow-functions function-binding class-fields
Asynchronous map function that await's returns Promise instead of value

I have this code async function addFiles(dir,tree) { return (await readDir(dir)) .map(async (name) => {await readDir(dir); …

javascript async-await babeljs arrow-functions
Does PHP Support Arrow Function Syntax?

After complaining about the tumultuous task of writing the keyword function over and over, I asked someone about an easier …

php arrow-functions
ES6 arrow functions not working on the prototype?

When ES6 Arrow functions don't seem to work for assigning a function to an object with prototype.object. Consider the …

javascript prototype ecmascript-6 arrow-functions
Can I use arrow function in constructor of a react component?

This question is similar to When using React Is it preferable to use fat arrow functions or bind functions in …

javascript reactjs constructor ecmascript-6 arrow-functions
Official information on `arguments` in ES6 Arrow functions?

(() => console.log(arguments))(1,2,3); // Chrome, FF, Node give "1,2,3" // Babel gives "arguments is not defined" from parent scope According to Babel (…

javascript ecmascript-6 arrow-functions
Typescript overload arrow functions

So we can do: export function myMethod (param: number) :number export function myMethod (param: string) :string export function myMethod (param: …

typescript overloading arrow-functions