search will start from position 10 and return the index of the first occurrence of 'merry' from the entire stringĬonsole.log('We wish you a merry christmas'.indexOf('merry',10)) Let us see another example with both the arguments passed. Output:- other is not included in string : We wish you a merry christmas We will be checking if the substring ‘merry’ is contained in the string ‘We wish you a merry christmas’ let mainString = "We wish you a merry christmas"Ĭonsole.log(`$`)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |