Possible Duplicate:
Remove item from object
I have an object like below:
questions = new Object();
questions = {
"q1":"answer1",
"q2":"answer2",
"q3":"answer3",
"q4":"answer4"
}
How do remove q3 and q4 and still preserve q1 and q1? Please suggest as dynamic approach to this as you can because questions object is populated dynamically and could have different number of items.
I tried using .slice with no luck:
question = "q2";
questions = questions.slice(0, question);