📅  最后修改于: 2022-03-11 15:02:55.743000             🧑  作者: Mango
let person = {
name : 'John Doe',
age : 35
}
//Now we can add element by 2 ways
person.occupation = 'Web Designer'
//or
person['occupation'] = 'Web Designer'; //This is usefull for adding element within loop.
object[yourKey] = yourValue;
object.yourKey = yourValue;