Menu
![]() ![]() ![]() If you need to support Internet Explorer, you should instead use the String#indexOf() method, which has been a part of JavaScript since ES1 in 1997. You can also use String#includes() in Node.js >= 4.0.0.Ĭompatibility table from Mozilla Developer Network You can use String#includes() in all modern browsers except Internet Explorer. ![]() The more modern way is the String#includes() function. There's two common ways to check whether a string contains a substring in JavaScript. ![]()
0 Comments
Leave a Reply. |