Es6 map ergodic problem

   
I output the f here twice, why col only outputs it once! Ask for answers

Mar.11,2022

feel that your writing is wrong, try this way:

columns.map((f,i) => {
  console.log('f',f);
  f.map((item.index) => {
      const col = {
        title: this.renderColumnTitle(f),
        dataIndex: 'column' + index,
        key: item._ref,
      };
      console.log('col',col);
  })
})

f is an array? Didn't he just output once?


is output only once. The 2 you see is length


f is just an item in columns . You should take a look at the data structure of columns .


where can I see the output twice.

Menu