javascript string find character code example
Example 1: How find a specific character in js
var word = "This is how you locate a word in a string";
var n = word.includes("word");
Example 2: find char in string javascript
var str = "Hello world, welcome to the universe.";
var n = str.indexOf("e");
Example 3: js string search
var str = "This is a test sentence";
var hasTest = str.includes("test");
if(hasTest == true){
}
Example 4: 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");