function largestOfFour (arr) {
return arr.map(Function.apply.bind(Math.max, null));
}
largestOfFour([[1,34],[456,2,3,44]); //[34, 456]
上面这个函数当中的Function.apply.bind 是怎样执行的,详细的过程是什么?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
笔记 bind.apply
相当于这样:
具体的难点,就在apply上了