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.

I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains:
-
DevOps School – Tech blogs and tutorials
-
Holiday Landmark – Travel stories and guides
-
Stocks Mantra – Stock market strategies and tips
-
My Medic Plus – Health and fitness guidance
-
TrueReviewNow – Honest product reviews
-
Wizbrand – SEO and digital tools for businesses
I’m also exploring the fascinating world of Quantum Computing.