xxxxxxxxxx
const myProfile = {
title: "@EverythingDebug",
url: "https://twitter.com/EverythingDebug",
tweets: 9,
followers: 4,
following: 6
};
const myTitle = 'title';
const myFollowers = 'followers';
console.log(myProfile[myTitle]); // "@EverythingDebug"
console.log(myProfile[myFollowers]); // 4
xxxxxxxxxx
const myProfile = {
title: "@EverythingDebug",
url: "https://twitter.com/EverythingDebug",
tweets: 9,
followers: 4,
following: 6
};
console.log(myProfile['title']); // "@EverythingDebug"