arr.reduce(function (x, y) {return x * y;}) 这个不对吗?为什么出来的值是undefined?
你这么写product函数没有返回值,那个return 是reduce里面函数的返回值。这样知道怎么改了吧。
Sign in to make a reply
chenshuoooooo
arr.reduce(function (x, y) {return x * y;}) 这个不对吗?为什么出来的值是undefined?