0% found this document useful (0 votes)
10 views2 pages

Js Stuff

Arrow functions have a shorter syntax and allow for implicit returns, unlike normal functions which require explicit returns. Normal functions have an 'arguments' object that stores all arguments, while arrow functions do not and instead refer to the outer scope. Additionally, 'this' binding in normal functions is determined by the call context, whereas in arrow functions, 'this' is lexically bound to the surrounding scope.

Uploaded by

aliesiere42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Js Stuff

Arrow functions have a shorter syntax and allow for implicit returns, unlike normal functions which require explicit returns. Normal functions have an 'arguments' object that stores all arguments, while arrow functions do not and instead refer to the outer scope. Additionally, 'this' binding in normal functions is determined by the call context, whereas in arrow functions, 'this' is lexically bound to the surrounding scope.

Uploaded by

aliesiere42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Arrow functions vs Normal functions

1) Shorter syntax and Implicit returns: it has a shorter syntax compared to normal functions also
for single line expression it auto return them without needing for explicit return.

2) Arguments Object: Normal function have an array like object which stores all the arguments in it
“ argumetns”.

If we were to try this with arrows functions it would throw a reference error, coz they don’t
have their “arguments” object instead they will refer to the outer scope (lexical).
3) This binding: In normal functional “this” is determined by how the function is called, if we were
to call normal function (dynamic this) in a global context it would point to the global object, if
we were to call it as a method of an object it would point to the object. In regular functions
“this” is determined at runtime.

You might also like