1var words = ['Hello', 'world'];
2
3var lengths = words.map(function(word) {
4 return word + ' = ' + word.length;
5});
6
7console.log(lengths);
1let data = [ { "id": 1, "is_read": true, }, { "id": 2, "is_read": true, }, { "id": 3, "is_read": false, }, { "id": 4, "is_read": true, }, ],
2length = data.filter(function(item){
3 return item.is_read;
4}).length;
5console.log(length)