利用map
方法方便获得对象数组中的特定属性值们。例如下面这个例子:
var users = [
{name: "张含韵", "email": "zhang@email.com"},
{name: "江一燕", "email": "jiang@email.com"},
{name: "李小璐", "email": "li@email.com"}
];
var emails = users.map(function (user) { return user.email; });
console.log(emails.join(", ")); // zhang@email.com, jiang@email.com, li@email.com
文末附上博主自己写的视频小网站,各种最新免费电影视频资源 www.searchg.cn