js strpos code example
Example 1: 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 2: indexof javascript
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");
<Checkbox
checked={value.indexOf(option) > -1}
value={option}
/>
Example 3: js strpos
var str = "Hello world, welcome to the universe.";
var n = str.indexOf("welcome");
Example 4: indefOf
const beasts = ['ant', 'bison', 'camel', 'duck', 'bison'];
console.log(beasts.indexOf('bison'));
Example 5: .index of javascript
let monTableau = ['un', 'deux','trois', 'quatre'] ;
console.log(monTableau.indexOf('trois')) ;