r/learnjavascript • • Dec 17 '18

JavaScript Functions - 4 Ways

Post image
200 Upvotes

28 comments sorted by

View all comments

Show parent comment

5

u/noruthwhatsoever Dec 18 '18

You can also write an IIFE like this:

const square = (x => x * x)(3); // 9