Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Arrays!
You have completed JavaScript Arrays!
Preview
Write a program using the join(), includes(), and indexOf() array methods you learned about earlier.
Resources
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
We'll use the includes method
to search an array of products.
0:00
We'll create a small search feature for
a product list.
0:01
All products that are currently in stock,
like eggs, milk, and
0:05
bread get stored inside an array.
0:09
We'll create a program that lets you
search if a product is in stock or not.
0:12
The program will also list all of
the products that are in stock.
0:17
To follow along,
open the file search-list.js, and
0:21
make sure to update
the script tag in index.html.
0:26
The src attribute should
point to js/search-list.js.
0:29
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