DEV Community


Discussion on: Keeping Your Code Simple

joelnet profile image
JavaScript Joel

No. What i am saying is let lenX = str1.length will produce a null reference exception because str1 is not available outside the reducer.

Thread Thread
themightyt_v3 profile image

yes sorry you're right... I misread it

Thread Thread
fc250152 profile image
Nando • Edited

imho the external assignment cannot however work ... i think that it isn't evaluated at each cycle of reduce ... or am I wrong ?