Created
September 7, 2022 01:32
-
-
Save iamdaniele/780a621a6c9589d25e2357b568d0bfdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lookupUser = (tweet) => { | |
const authorId = tweet.data.author_id; | |
let author = {}; | |
for (const user of tweet.includes.users) { | |
if (user.id === authorId) { | |
author = user; | |
return user; | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment