Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
data={ statuses:
   [ { created_at: 'Sun May 07 11:35:16 +0000 2017',
       id: 861182642888343600,
       id_str: '861182642888343552',
       text: '@was_going \nEvery hunk bore seven drums,\nEvery drum owned seven drums…',
       truncated: false,
       entities: [Object],
       metadata: [Object],
       source: '<a href="http://cheapbotsdonequick.com" rel="nofollow">Cheap Bots, Done Quick!</a>',
       in_reply_to_status_id: 861181362954489900,
       in_reply_to_status_id_str: '861181362954489856',
       in_reply_to_user_id: 795028044758949900,
       in_reply_to_user_id_str: '795028044758949888',
       in_reply_to_screen_name: 'was_going',
       user: [Object],
       geo: null,
       coordinates: null,
       place: null,
       contributors: null,
       is_quote_status: false,
       retweet_count: 0,
       favorite_count: 0,
       favorited: false,
       retweeted: false,
       lang: 'en' },
     { created_at: 'Sun May 07 11:35:09 +0000 2017',
       id: 861182610596405200,
       id_str: '861182610596405248',
       text: 'Would you rather have Data storage or A pedal assembly for a bass drum or high hat cymbals?',
       truncated: false,
       entities: [Object],
       metadata: [Object],
       source: '<a href="http://cheapbotsdonequick.com" rel="nofollow">Cheap Bots, Done Quick!</a>',
       in_reply_to_status_id: null,
       in_reply_to_status_id_str: null,
       in_reply_to_user_id: null,
       in_reply_to_user_id_str: null,
       in_reply_to_screen_name: null,
       user: [Object],
       geo: null,
       coordinates: null,
       place: null,
       contributors: null,
       is_quote_status: false,
       retweet_count: 0,
       favorite_count: 0,
       favorited: false,
       retweeted: false,
       lang: 'en' } ],
  search_metadata:
   { completed_in: 0.034,
     max_id: 861182642888343600,
     max_id_str: '861182642888343552',
     next_results: '?max_id=861182610596405247&q=drum&count=2&include_entities=1',
     query: 'drum',
     refresh_url: '?since_id=861182642888343552&q=drum&include_entities=1',
     count: 2,
     since_id: 0,
     since_id_str: '0' } };
let results = data.statuses.filter(
   result=>result.hasOwnProperty('text') 
).map(result=>result.text); 
console.log(results);
console.log("method 2:");
results= data.statuses.reduce((arr,result)=>(result.text&&arr.push(result.text)&&false)||arr,[]); 
console.log(results);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers