add javascript reduce