How to add new key value pair into existing object
问题 I have a simple function: function pagination(opt, limit){ console.log(opt); //logs out this-> [Object { limit="2", layout="getConversations"}] if (typeof opt === 'object') { var list = { data: [opt] } list.data['limitstart'] = 24; //undefined console.debug(data); //here it should list three key value pairs including limitstart which just added } } I tried this: list.data.push({ 'limitstart': 24 }); //creates another object. expected output: [Object { limit="2", layout="getConversations",