鍍金池/ 問答/網(wǎng)絡安全  HTML/ js中map函數(shù)兩個參數(shù)調換位置?

js中map函數(shù)兩個參數(shù)調換位置?

剛開始學習React,看到阮一峰老是的入門Demo5里介紹this.props.children中用到map方法,
這里的map接收了兩個參數(shù),標準格式不應該是 arr.map(callback[,thisArg])這種嗎,參數(shù)調換位置也可以?

React.Children.map(this.props.children, function (child) {
          return <li>{child}</li>;
        })
回答
編輯回答
魚梓

React.Children.map != Array.map
這個是react封裝的map并不是js數(shù)組的map方法

2017年5月29日 19:13