filmov
tv
javascript - How do I check whether an array contains a string in TypeScript?

Показать описание
#short
#javascript
#arrays
#typescript
Currently I am using Angular 2.0. I have an array as follows:
var channelArray: Arraystring = ['one', 'two', 'three'];
How can I check in TypeScript whether the channelArray contains a string 'three'?
#javascript
#arrays
#typescript
Currently I am using Angular 2.0. I have an array as follows:
var channelArray: Arraystring = ['one', 'two', 'three'];
How can I check in TypeScript whether the channelArray contains a string 'three'?