Menu

What is Middleware in Express and How It Works
🖼️

What is Middleware in Express and How It Works

DEV Community·Abhishek sahni·6 months ago
#E624ay9J
#webdev#javascript#chaicode#frontend#function
Reading 0:00
15s threshold

Arrow function Introduced in ES6. They provide concise syntax to write a standard function.

Standard Function :

function add ( a , b ){ return a + b ; }

Enter fullscreen mode

Exit fullscreen mode

Arrow Function :

const add = ( a , b ) => a + b ;

Enter fullscreen mode

Exit fullscreen mode

Arrow function are anonymous don't have name . You cannot give it a name during definition.

Assigned to Variables : To reuse or reference an arrow function, you must assign it to a variable (e.g., const myFunc = () => { ... }; ).

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

greet (); // reuse greet (); // reuse again

Enter fullscreen mode

Exit fullscreen mode

They are design for inline code that and reduce syntax .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.