js find char in string code example
Example 1: find char in string javascript
var str = "Hello world, welcome to the universe.";
var n = str.indexOf("e");
Example 2: javascript indexof
var colors=["red","green","blue"];
var pos=colors.indexOf("blue");
var str = "We got a poop cleanup on isle 4.";
var strPos = str.indexOf("poop");
Example 3: indexof javascript
Array.indexOf(searchElement, fromIndex)
Example 4: .index of javascript
let monTableau = ['un', 'deux','trois', 'quatre'] ;
console.log(monTableau.indexOf('trois')) ;