DEV Community

Discussion on: Mastering Hard Parts of JavaScript: Callbacks I

 
deryckhenson profile image
Deryck Henson

better yet, typeof initialValue !== 'undefined' so you avoid touching arguments at all

Thread Thread
 
semigradsky profile image
Dmitry Semigradsky

initialValue can be undefined

Thread Thread
 
deryckhenson profile image
Deryck Henson

yes...but accum = initialValue loses its purpose if it is.