axios方法
getmovie:function () {var that = this;axios.get("https://douban.uieee.com/v2/movie/top250").then(function (response) {var arr=response.data.subjects;console.log('arr', arr);let titleList = arr.map((item, index)=>{return item.title;/*-------map方法---------*/})that.movie=titleList;console.log(titleList);},function (err) {})}}
map遍历方法
map() 方法返回一个新数组,数组中的元素为原始数组元素调用函数处理后的值。
map() 方法按照原始数组元素顺序依次处理元素。
写法(1)let a=数组.map((item,index)=>{
return item.要获取的属性
})
写法(2)**array.map(function(currentValue,index,arr), thisValue)
**
