Object.keys và Object.getOwnPropertyNames

object,tipjs,function

Object.keysObject.getOwnPropertyNames

Person = function(name){
    this.name = name || ''
}
Person.prototype.sayHello = function(){
    console.log('hello')
}
p = new Person('yangyang')
p.age = 18
Object.defineProperties(p, {
    age:{
        enumerable:false
    }
})
console.log(Object.keys(p)) // ["name"]
console.log(Object.getOwnPropertyNames(p))  // ["name", "age"]

Có thể bạn đã miss một số snippets code

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

Hàm lày ngày trong tuần javascript

Hàm lày ngày trong tuần javascript

kiểm tra email trong javascript

kiểm tra email trong javascript

String.prototype.trimEnd

trimEnd() Phương thức xóa khoảng trắng từ đầu chuỗi và trả về một chuỗi mới. Có nghĩa là trimEnd() xoá những ký tự space bên phải mà không làm thay đổi chuỗi gốc.

Converting Object to an Array

Converting Object to an Array