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

Clearer Directions

Hi,

In the first step of this practice, it states:

Write the code for function addNewTeachers() found on line 35. This function should receive parameter newTeachers, defined on line 52, and add the new teachers to the treehouseTeachers variable.

This led me to believe that a new variable treehouseTeachers needed to be created, but said variable was never mentioned in the solution.

1 Answer

Hey Xavier, this question requires you to write out a function that will take as its only argument an array of object literals that contain key-value pairs about teachers contained in the variable newTeachers and add the new teachers to the array with the variable name teachers, if I remember correctly. I did this practice just earlier tonight and I was a bit confused at first too. The practice session is written out in a confusing way. My thoughts on this are to accept the sloppiness and just put in the time necessary to read through the code and figure things out, since once you're working as a professional you will need to do exactly that only with much messier and more confusing code. Hopefully you figured it out!

Yup, I was able to figure it out. Thanks for the response Michael !