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

Javascript function conundrum

Can anyone help me with this? I'm stumped...

Define a function createApp which takes your info and education as arguments in that order. The function should then return an object (you'll need to create it). This object should have two properties. The property names must be the same as your variable names. Set the values of these properties to the corresponding arguments.

1 Answer

It's easier to answer questions like this when you link to the actual challenge, but I believe it's asking for something like this:

function createApp (info, education) {
 this.info = info;
 this.education = education;

 return {
   info  : this.info,
   education: this.education
 }
}

This will work, but you don't have to set this.info and this.education; you can use the info and education arguments directly in the returned object.

Also, to link your question to the challenge like Colin suggested, you can post your question using the Get Help button on the Code Challenge page.

Perfect! Thanks so much Colin.

Thanks Milo!