DEV Community

Discussion on: How you can learn Closures in JavaScript and understand when to use them

Collapse
 
codewilling profile image
Sean Flores

Thanks for the write-up. I'm trying to deeply understand every operation that you cite, but I'm getting an error in this example. What am I doing wrong? jsbin.com/basapo/1/edit?js,console. Thanks.

Collapse
 
softchris profile image
Chris Noring

it's just first line, you forgot =. Should read

const multiply = (a, b) => a * b;

Collapse
 
codewilling profile image
Sean Flores

Thank You! that's what I thought, but I thought you were writing this line with a JS feature I didn't know. I copied and pasted it from your article, you may want to change it in your article also. :-).