Skip to content

Instantly share code, notes, and snippets.


conanak99/addRemoveField.js Secret

Created Jan 13, 2016
What would you like to do?
var person = {
firstName: 'Hoang',
lastName: 'Pham',
showName: function() {
console.log(this.firstName + ' ' + this.lastName);
delete person.lastName; // Xóa trường lastName
person.lName = 'Just adding'; // Thêm trường lName
console.log(person.lastName); // undefined
console.log(person.lName); // Just adding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment