I am having a dictionary which maps question-id to the question. While printing contents of dictionary, I want to access the elements in the order in which they were added. The question id is a random 10-digit string. This printing will be done numerous times. A dictionary elements can also be deleted in which case it will simply disappear while leaving the other elements in the exact same order.
It is probably not possible without creating a dictionary class of my own. Or is it?
var question_dic = {};
question_dic["2186242050"] = "Answer to life, universe and everything?"; //adding a key-value pair
delete question_dic[delete_key]; //remove delete_key key