js: recursive sum list/array