Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Object-Oriented JavaScript (2015) Introduction to Methods Different Kinds of Objects

Nelson Lee
Nelson Lee
6,853 Points

Values stored in objects are called

This should be key value pair. however its wrong

3 Answers

Steven Parker
Steven Parker
231,275 Points

:warning: SPOILER ALERT


Only certain kinds of objects (dictionaries, for example) have key/value pairs.

:point_right: The more general term for object values is "properties".

Steven Parker I appreciate your humor here along w. the information. Are you a Dr. Who fan? There are many "spoilers" from River Song too. ;)

Steven Parker
Steven Parker
231,275 Points

Sure, I enjoy Dr. Who, but I wasn't thinking of it when I wrote that.

By "spoiler" I just meant that it gives away the exact answer to the quiz question.

After 4 months, are you just now getting back to the course? :hourglass:

Julie Myers
Julie Myers
7,627 Points

In general an object in javaScript is said to be made up of key/value pairs. These key/value pairs can either be properties or methods. For example:

var friends = {
  firstName: "Jack",
  lastName: "Apple",
  getFullName: function() {
    console.log("My friends name is: " + this.firstName + " " + this.lastName);
  }
}

/*
firstName and lastName are properties of the object friends.
getFullName is a method of the object friends.

firstName is the key. "Jack" is the value.
lastName is the key. "Apple" is the value.
getFullName is the key. The anonymous function is the value.
*/

It takes a while to get used to how the terms in a programming language are used. You'll get used to it.