Kevins answer is correct but it requires a "magic" number as follows: var containsChar = s.indexOf(somechar) !== -1;
var containsChar = s.indexOf(somechar) !== -1; In that case you need to know that -1 stands for not found. I think that a bit better version would be: var containsChar = s.indexOf(somechar) >= 0;
var containsChar = s.indexOf(somechar) >= 0;