JSFiddle - React, Tailwind, and code Playground
JavaScript
var str="I want a Whopper";
var searchStr="Whopper";
var pos=str.indexOf(searchStr);
document.writeln("'" + searchStr + "' is in position " + pos + " of the string: '" + str + "'" );
document.writeln("<br>");