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

using Typescript callback style error handling

Merge Array

How to combine two sorted arrays into one? We can do this easily with the spread operator.

Converting Object to an Array

Converting Object to an Array

try/catch es10

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

Kiểm tra định dạng email bằng Javascript

Kiểm tra định dạng email bằng Javascript