In this short video, I tried to quickly tell you all about the includes() method and indexOf() method in JavaScript, used to find the substring in a string.
String.includes() :-
It's a simple method that returns a boolean value depending on whether the string contains the substring or not.
String.indexOf() :-
This method returns the index of the substring, you need to compare it to -1 to know if the substring was found or not.
Thanks for watching.
#javascript
On this page of the site you can watch the video online Check if a string contains a substring in JavaScript. with a duration of hours minute second in good quality, which was uploaded by the user Anil Bhatt 01 August 2022, share the link with friends and acquaintances, this video has already been watched 1,592 times on youtube and it was liked by 34 viewers. Enjoy your viewing!