How do I remove an entry, such as [2] from below?
var object = {};
object[0] = true;
object[1] = true;
object[2] = true;
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.
This will work:
I would suggest you don’t use “object” as your variable name.
“object” is a reserved word.Also, see this question: how-to-remove-a-property-from-a-javascript-object
EDIT:
Actually “object” is not on the list of reserved words. But “Object” (capital “O”) does have a meaning in JavaScript. So I would discourage using that name anyway.