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 trialNelson Lee
6,853 PointsValues stored in objects are called
This should be key value pair. however its wrong
3 Answers
Steven Parker
231,275 PointsSPOILER ALERT
Only certain kinds of objects (dictionaries, for example) have key/value pairs.
The more general term for object values is "properties".
Julie Myers
7,627 PointsIn 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.
vivek chaudhary
3,575 Pointsproperties
A X
12,842 PointsA X
12,842 PointsSteven 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
231,275 PointsSteven Parker
231,275 PointsSure, 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?