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 trialAbdurashid Mahad Isse
7,062 Pointsplease somebody help me with this...
https://teamtreehouse.com/library/methods-3
<!DOCTYPE html>
<html lang="en">
<head>
<title> JavaScript Foundations: Objects</title>
<style>
html {
background: #FAFAFA;
font-family: sans-serif;
}
</style>
</head>
<body>
<h1>JavaScript Foundations</h1>
<h2>Objects: Methods</h2>
<script>
var genericGreet = function() {
return "Hello, my name is " + this.name;
}
var andrew = {
name: "Andrew"
}
var ryan = {
name: "Ryan"
}
</script>
</body>
</html>
1 Answer
Leonardo Hernandez
13,798 Points // The question is asking you to add this method(function) below to the objects 'andrew' and 'ryan'
var genericGreet = function() {
return "Hello, my name is " + this.name;
}
//Andrew has the property "name" and we want to add another property "greet". Set the value of it.
var andrew = {
name: "Andrew"
//Add a new property.
/* Seperate multiple properties with a comma. The last one should not have one.
propertyName: propertyValue,
propertyName: propertyValue,
propertyName: propertyValue
*/
}
var ryan = {
name: "Ryan"
}
eck
43,038 Pointseck
43,038 PointsHave you tried anything for this challenge yet? If you have, we can do over what you wrote.