IndexOf()?

So I'm brand new to Java working on JavaScript right now just doing some fiddling to figure it out since I will be needing it in the near future. Currently working with trying to parse a s sting and send it out as an alert pretty simple right? well I thought so but keep getting the error "Error: TypeError: value.indexOf is not a function". Not sure what I am doing wrong any help would be great. Compilable code included.