This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Letβs clean up our object instantiation and output and move it out of our class file. Our cookbook will use more than one class so this is a great point to start separating the concerns.
Challenges
Now that we've seen how to get and set an associative array, try adding some new methods around ingredients. Such as:
- Converted to a simple array of ingredient strings
- Converted to just a string of ingredient items
- Return the ingredients formatted in a list
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up