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.

Instagram ● Twitter ● Facebook

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

codedrops.tech

Discussion (0)