Using “for in” over a string to find a character but then not able to use the variable to reference another value still learning JS and confused over this