Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    \$\begingroup\$ I think you can save 3 bytes by using parseInt(a,b) instead of parseInt(a[0],b) since parseInt converts the first argument to string and ignores everything starting at the first invalid character (i.e. ','). \$\endgroup\$ Commented Sep 23, 2016 at 8:21
  • 1
    \$\begingroup\$ I also think you can save some bytes by using a[0]?stuff():0 instead of a.length&&stuff() \$\endgroup\$ Commented Sep 23, 2016 at 8:31
  • \$\begingroup\$ @Lmis Thanks, I've updated it :) \$\endgroup\$ Commented Sep 23, 2016 at 8:44
  • 1
    \$\begingroup\$ I think you can shorten this to 40 bytes: f=([b,...a],c)=>b?parseInt(b,c)+f(a,b):0 \$\endgroup\$ Commented Sep 24, 2016 at 18:07
  • \$\begingroup\$ @Neil nice way of not using the slice function \$\endgroup\$ Commented Sep 25, 2016 at 9:59