Python Add All Values In Array Function Javascript Code