let str = 'Widget with id';
alert( str.indexOf('Widget') ); // 0, because 'Widget' is found at the beginning
alert( str.indexOf('widget') ); // -1, not found, the search is case-sensitive
alert( str.indexOf("id") ); // 1
CodePudding user response:
There is an "id" inside "Widget"
CodePudding user response:
Look closer to your string: "Widget with id"
