I need to know if a JavaScript object contains a certain variable.
EG:
Check if ‘map’ contains ‘here’
var map = {
'10': '0',
'20': '0',
'30': 'here',
},
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.
You have to loop through the object to test it:
You can also put this in
Objectprototype:Demo: http://jsfiddle.net/DerekL/yWnYy/