Hướng dẫn not includes javascript
Asked 6 years, 7 months ago Viewed 116k times I have this javascript code:
I understand that I can do a simple match here:
To check the toState name. But how could I check the toState.name does not include the string:
for example the toStateName could be:
asked Feb 12, 2016 at 6:07 1 ES6 version of this is (check out answer from Allison):
The original accepted answer was: You are looking for indexOf
answered Feb 12, 2016 at 6:10
AnanthAnanth 4,0722 gold badges19 silver badges26 bronze badges answered Sep 29, 2018 at 1:24
AllisonAllison 1,5971 gold badge17 silver badges23 bronze badges 1
Using the JS includes method would probably be your best bet. I get I'm a little late in answering
this question, but I was just googling this myself and came up with this answer after some fiddling with the code. This code will return true if Hope this helps anyone searching the same question I had! answered Aug 15, 2018 at 14:00
briflan26briflan26 1011 silver badge6 bronze badges
answered Feb 12, 2016 at 6:11
gurvinder372gurvinder372 65.1k9 gold badges69 silver badges90 bronze badges 2
The original question contained a "?" ternary operator, so here is how to do it using a ternary operator. Suppose you're writing a poker game and have a rainbow flop. Now suppose you want the missing suit from the flop.
answered Feb 12, 2019 at 3:44
2 For me jQuery Version is 1.10.2 To check the substring within the string you can use includes jQuery function like this
answered Jun 17, 2019 at 8:50
|