Skip to content

Instantly share code, notes, and snippets.

@anartzdev
Created November 7, 2022 06:21
Show Gist options
  • Save anartzdev/421e936ab3cb77026830cc788ef7d0d0 to your computer and use it in GitHub Desktop.
Save anartzdev/421e936ab3cb77026830cc788ef7d0d0 to your computer and use it in GitHub Desktop.
Dynamic Access Object - Javascript
const myPersonalData = {
name: 'Anartz',
lastname: 'Mugika Ledo',
birthday: '10-01-1986',
hobbies: [
'hobbies: sports, photography, studying health and technology topics',
],
blog: 'https://mugan86.medium.com/',
portfolio: 'https://anartz-mugika.com/',
};
const getDataKeys = ['name', 'lastname', 'portfolio'];
getDataKeys.forEach((key) =>
console.log(`${key.toUpperCase()}: ${myPersonalData[key]}`)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment