Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidystephenson/3e54107b0a7a9f92a1efb29d817911cd to your computer and use it in GitHub Desktop.
Save davidystephenson/3e54107b0a7a9f92a1efb29d817911cd to your computer and use it in GitHub Desktop.
// 5. Declare an object named "person" with properties "name", "age", and "city" and set their respective values to
// "John", 30, "New York" and hobbies as "reading", "swimming", "traveling". Print the name, age, and city of the person.
var person = {
name: 'John',
age: 30,
city: 'New York',
hobbies: ['reading', 'swimming', 'traveling']
}
console.log(person.name)
console.log(person.age)
console.log(person.city)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment