Possible Duplicates:
Javascript – array.contains(obj)
Best way to find an item in a JavaScript Array ?
I want to check, for example, for the word “the” in a list or map. Is there is any kind of built in function for this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In javascript you have Arrays (lists) and Objects (maps).
The literal versions of them look like this:
if you which to figure out if a value exists in an array, just loop over it:
if you which to figure out if a map has a certain key or if it has a key with a certain value, all you have to do is access it like so: