sum function

JS task "sum" completed and commented.