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

Extend Object javascript

Extend Object javascript

Detect when your site is visible to users

Detect when your site is visible to users

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

snowflake là gì

snowflake là gì? Năm 2010, Twitter có nguồn mở Snowflake, một thuật toán tạo ID duy nhất trên toàn cầu được sử dụng bởi nhóm nội bộ của nó, được dịch thành Snowflake.

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.