DEV Community

Mehul Lakhanpal
Mehul Lakhanpal

Posted on • Originally published at codedrops.tech

Rewriting normal function as arrow function

const func = function() {
    console.log('a');
    return 5;
};
func();
Enter fullscreen mode Exit fullscreen mode

Equivalent arrow function of the above Regular function

const func = () => (console.log('a'), 5);
func();
Enter fullscreen mode Exit fullscreen mode

Thanks for reading 💙

Follow @codedrops.tech for daily posts.

InstagramTwitterFacebook

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript

codedrops.tech

Top comments (0)