🚗🏍️ Welcome to Motoshare!

Turning Idle Vehicles into Shared Rides & New Earnings.
Why let your bike or car sit idle when it can earn for you and move someone else forward?

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Partners earn. Renters ride. Everyone wins.

Start Your Journey with Motoshare

Arrow Function in JavaScript

Uncategorized

Arrow function

Arrow function is one of the features introduced in the ES6 version of JavaScript. It allows you to create functions in a cleaner way compared to regular functions. For example,

you can define a simple arrow function as follows:

const greet = () => {
    console.log("Hello!");
};

greet(); // Output: Hello!

In this example, the arrow function greet does not take any parameters and simply logs “Hello!” to the console.

Here’s an example of an arrow function with a parameter:

const square = (num) => {
    return num * num;
};

console.log(square(5)); // Output: 25

The arrow function square takes a num parameter, multiplies it by itself, and returns the result.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x