JSFiddle - React, Tailwind, and code Playground JavaScript var str="This is JavaScript indexOf() Method"; var n=str.indexOf("indexOf()"); alert(n);