Created
March 14, 2016 09:13
-
-
Save OlegLustenko/141f5ec267b16b8c2a89 to your computer and use it in GitHub Desktop.
Revisions
-
OlegLustenko created this gist
Mar 14, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ function add (a, b) { let res = '', c = 0 a = a.split('') b = b.split('') while (a.length || b.length || c) { c += ~~a.pop() + ~~b.pop() res = c % 10 + res c = c > 9 } return res }