Hello,
You have an infinite loop. Your index never changes so
(index = params.indexOf(c, index)) always produces the position of the desired character which is never
-1 (unless the character isn't in the String, which would produce a
-1) - and so the infinite loop.
Also, your code doesn't do what your
thread topic is asking about. Your code doesn't count anything. It can be modified to find the position of your desired character by
incrementing index and
not count - but I'm not sure that is what you are trying to do.
My powers of guessing are dwindling - it's too late... must sleep... I probably don't have the wherewithal to spell my name correctly...
Good Luck,
-Fred Flinstone
...or make up a good joke.