Created
August 31, 2021 15:36
-
-
Save tararoutray/173fb059b0dd86cc06f953532a71d2e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// String.includes() | |
// The includes() method returns true if a string contains a specified value, otherwise false. | |
let message = "The movie is yet to begin!"; | |
message.includes("begin"); // This will return true. | |
// String.startsWith() | |
// The startsWith() method returns true if a string begins with a specified value, otherwise false. | |
let message = "The movie is yet to begin!"; | |
message.startsWith("The"); // This will return true. | |
// String.endsWith() | |
// The endsWith() method returns true if a string ends with a specified value, otherwise false. | |
let message = "The movie is yet to begin!"; | |
message.endsWith("begin!"); // This will return true. | |
message.endsWith("begin"); // This will return false. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment