let arr =[ {title:'aaaa',read:100,hot:true}, {title:'bbbb',read:50,hot:false}, {title:'ccc',read:100,hot:true} ]; let newArr =arr.map((item,index,arr)=>{ let json ={}; json.t=`---${item.title}----------`; json.r =item.read+200; json.hot =item.hot ==true && '真棒'; return json; }) console.log(newArr) //map非常有用,做数据交互,'映射' // 正常情况下,需要配合return,返回一个新的数组 //若是没有return,相当于forEach //平时只有用到map一定要有返回值