find char in string js code example
Example 1: find char in string javascript
var str = "Hello world, welcome to the universe.";
var n = str.indexOf("e");
Example 2: js string search
var str = "This is a test sentence";
var hasTest = str.includes("test");
if(hasTest == true){
}
Example 3: 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 4: 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 5: .index of javascript
let monTableau = ['un', 'deux','trois', 'quatre'] ;
console.log(monTableau.indexOf('trois')) ;