0
votes

I have created a method, here I have tried to use indexOf() and includes() both. But i am getting an error message like " Object doesn't support property or method 'includes' ". Even i have tried to run both IE and Chrome as well, but getting same error. If any one knows please help me.

1
Are you sure control.value is returning string in this case Maybe take look at type in dev tools. - asantaballa
it's because str is not a String, it's an Object. I'm fairly confident that console.log(str+'......') outputs [Object object].......... - Jeremy Thille
@JeremyThille Yes, you both are correct. It's not returning string. Thanks for help. - Roy
@asantaballa, Yes your correct, it's not returning string. Thanks for help. - Roy

1 Answers

1
votes

You made a small mistake. Just convert 'control.value' into string.

var str=String(control.value);