DEV Community

Discussion on: Different types of Functions in JavaScript

Collapse
 
gypsydave5 profile image
David Wickes • Edited

Very comprehensive!

Couple of typos:

Your default parameters examples has ; instead of , between the arguments

const multiply = (a = 2, b = 3, c = 1) => a * b * c;
Enter fullscreen mode Exit fullscreen mode

You're missing a ' on your new Function example:

var sum = new Function('a', 'b', 'return a + b');
Enter fullscreen mode Exit fullscreen mode

(I love that you introduce the Function constructor by the way - hours of fun for everyone there)

Collapse
 
jaamaalxyz profile image
Md. Jamal Uddin • Edited

Bull's eye man! truly I have read my post more than 10 times :) and two of my friends proofread it but no one figured it out. I will be more prepared next time. thanks.