Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sum(ls) {
  2.     this.s = this.s||0;
  3.     s+=ls.pop();
  4.     return (ls.length>0)?this.sum(ls):this.s;
  5. }
  6.  
  7. document.write(sum([2,2,3]));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement