Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object.keys(), Object.values(), Object.entries() 그리고 for...in #27

Open
BKJang opened this issue Jul 9, 2019 · 0 comments
Open
Labels
Skill of JS It is related to skill of JS.

Comments

@BKJang
Copy link
Owner

BKJang commented Jul 9, 2019

Object.keys(), Object.values(), Object.entries() 그리고 for...in

Object.keys(), Object.values(), Object.entries()

const developer = {
  name : 'BKJang',
  age : 26,
  lang: 'Korean'
}

console.log(Object.keys(developer)); // ["name", "age", "lang"]
console.log(Object.values(developer)); // ["BKJang", 26, "Korean"]
console.log(Object.entries(developer)); 
/**
0: ["name", "BKJang"]
1: ["age", 26]
2: ["lang", "Korean"]
*/

for...in

const developer = {
  name : 'BKJang',
  age : 26,
  lang: 'Korean'
}

for(let key in developer) {
  console.log(`${key} : ${developer[key]}`);
}
/**
name : BKJang
age : 26
lang: 'Korean'
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skill of JS It is related to skill of JS.
Projects
None yet
Development

No branches or pull requests

1 participant