Tweets

Home

Part 1

Write JavaScript code to process the provided tweets variable to answer the questions below. Log each of the answers to the console.

  1. Display the screen name of the user who authored the first tweet (i.e. "@sandwoah").
  2. Of all the tweets which include the phrase "@sandwoah" in their full text, display the screen name of the user who authored that tweet, each on a separate line (i.e. "user2", then "user3").
  3. Of all the tweets which include the phrase "@sandwoah" in their full text, determine which tweet has the greatest number of likes, and then display the screen name of the user who authored that tweet (i.e. "user3"). NOTE: your solution should work regardless of what order the tweets are in.


Part 2

Write JavaScript code to process the provided tweets variable to answer the questions below. Display the answers on the page in the designated places.

  1. Sort all of the tweets on the basis of likes count in descending order, so the tweet with the highest likes is first.
  2. Display the sorted tweets in a table using the designated table element. The table should have five columns: "Tweet Id", "Tweet Text", "User Screen Name", "User Followers", and "Tweet Likes". There should be a row for each tweet. Include the tweet's id, full text, user screen name, user number of followers, and the tweet's likes count.