From the course: JavaScript: Arrays
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Solution: Evaluating single value 1 - JavaScript Tutorial
From the course: JavaScript: Arrays
Solution: Evaluating single value 1
(upbeat music) - [Instructor] In this challenge, we want to determine if an array includes a very specific value. So let's go ahead and get started. And we know for all of our challenges here, we want to make sure we're returning the solution that we came up with to check it against the correct solution. So I'm going to return fruits and then includes, because we're trying to see, does the array include the very specific string of Apple? And I've mentioned this before and we'll use this as a good way to kind of show you what I've mentioned before about string matching. So here, if I change Apple to lowercase, we should expect that this does not return the correct solution. So you can see here it returned false, which is incorrect. We actually know that it should be there. And if we change this casing here to Apple, with a capital A, and test it, we can see that we get the correct result. So it's really important. Make sure when you're doing any sort of string matching to make sure…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.