下記文章の中の「毒虫」は何文字目にあるかを調べたい時、indexOfメソッドを使えば目的の文字を検索できます。 布地の販売員をしている青年グレーゴル・ザムザは、ある朝自室のベッドで目覚めると、自分が巨大な毒虫になってしまっていることに気が付く。
JavaScript String indexOf() method : The indexOf() method is used to return the index value of specified string. It will give the index of string comes first from the start. We can also start ...