Look at the photo of this javascript line.
The includes() method is used to check if a string contains a specific substring. If the substring is found within the string, the method returns true; otherwise, it returns false. There is no in between (no undefined), either true or false.
So let's break this down.
Line 1: we're storing a string in a variable called message.
What are we storing in the variable? -> "JavaScript is great!"
I drew a red box around the method called includes.
Line 2: When we are utilizing this method, it's going to look at that entire string and look for the word script. It's going to report back either true or false. True meaning it found it, false meaning it did not find it.
π¨ Here is where it gets tricky, and you have to remember that when we're talking JavaScript and programming, it's case sensitive. And ask yourself as a computer program... do you see a lowercased "script" in the word "JavaScript is Great"? if you do not then you are a "FALSE" if you do see a lowercased "script" in it then you are a "TRUE".
π What will the following code output? Let's see your vote!