javascript - Official information on `arguments` in ES6 Arrow functions? -


(() => console.log(arguments))(1,2,3);  // chrome, ff, node give "1,2,3" // babel gives "arguments not defined" parent scope 

according babel (and can tell initial tc39 recommendations), "invalid" arrow functions should using parent scope arguments. info i've been able find contradicts single comment saying rejected tc39, can't find up.

just looking official docs here.

chrome, ff, , node seem wrong here, babel correct:

arrow functions not have own arguments binding in scope; no arguments object created when calling them.

looking official docs here

arrow function expressions evaluate functions have [[thismode]] set lexical, , when such called declaration instantiation not create arguments object. there specifc note (18 a) stating "arrow functions never have arguments objects.".


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -