programming masterpiece
Oct. 7th, 2013 08:41 am(from
code_wtf)
In JavaScript, calculate the sum of integers in a nested array.
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-community.gif)
In JavaScript, calculate the sum of integers in a nested array.
i.toSource().replace(/\[|\]/g, '').split(', ').forEach(function(a){if(a.match(/^\d$/)) s -= -a})