[Solved] When I enter 2 letters it searches about one one I would search about 2 letters at once to get value
[ad_1] If I understand what’s going on, your problem is this line: var index = code.indexOf(msg[i]); msg[i] is the same thing as msg.charAt(i), which only gives you a single character from the string. If you want to check two characters per index, you need to use String#substr(start, length) with a length argument of 2: var … Read more