MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

What are arrow functions in JavaScript?

JavaScript

An arrow function expression (previously, and now incorrectly known as fat arrow function) has a shorter syntax compared to function expressions. Arrow functions are always anonymous.

Arrow Function

  • Do not call before definition
  • An arrow function cannot contain a line break between its parameters and its arrow.

Arrow Function With Parameter

•With one Parameter
ď‚§Syntax: (para) => {statement};
ď‚§Syntax: para => {statement};
•More than one Parameter
ď‚§Syntax: (para1, para2, paraN) => {statement};
•No Parameter
ď‚§Syntax: ( ) => {statement};

Arrow Function with Parameter

•Default Parameter
ď‚§Syntax: (para1, para2 = value) => {statement};
•Rest Parameter
Syntax: (para1, …args) => {statement};

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x