"JavaScript? ?? ?? ???"?? Array.prototype.map
? ???? ? ???? ??? ????.
? call(null)
而不是直接使用f(a[i], i, a)
? ?????? ?? ??? ??? ???? ??? ????
認(rèn)證高級PHP講師
??? ??? ?? ? ?? ?????? ??? ? ?? map(array, f) ???? ? ? ????.
MDN?? ???? ?? ?????? ?? ???????.
const new_array = arr.map(callback[, thisArg])
??? ??? f?? ??? ???? ??? this? ?? ????, ??? ???? ??? ? ?? ?? ???? ???? ? ?? ???? ??? thisArg ?? ??? ????? ?? ??? null??? ???? ?? ?? ?? ??? ?????.
?? ?? ?? ?? ??? ??? ?,
? ??? ??? ??? ?? null ? undef? ??? this ?? ???? ?? ??(????? ? ??)? ???? this ?? ?? ?(??, ???, ?? ?) ?? ?? ???? ?? ?? ?????.
??? ??? ?? ??? ??? ? ???? ???? ??????? ???~