Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active April 28, 2022 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/f62f9b8097787fb6db0937051391a139 to your computer and use it in GitHub Desktop.
Save McLarenCollege/f62f9b8097787fb6db0937051391a139 to your computer and use it in GitHub Desktop.
Get Social Account Details

Given the socialAccountDetails and selectedAccount, create a function that returns the username for the selectedAccount.

function getUserName(account, accountDetails){
// write your code here
}
let selectedAccount = "gmail";

let socialAccountDetails = {
  gmail: {
    username: "vivek123",
    password: "password123",
  },
  facebook: {
    username: "vivek",
    password: "password",
  },
};
console.log(getUserName(selectedAccount, socialAccountDetails));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment