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

Làm phẳng mảng dùng phương pháp đệ quy

Làm phẳng mảng dùng phương pháp đệ quy

Rolling loading

Nguyên tắc là theo dõi các sự kiện cuộn trang và phân tích mối quan hệ thuộc tính giữa clientHeight , scrollTop và scrollHeight .

Đếm có bao nhiêu items giống nhau trong một array

reduce javascript. Đếm có bao nhiêu items giống nhau trong một array

Random String

Random String với độ dài tuỳ chọn

Remove item in array javascript es6

Những bạn nào mà đã sử dụng ES6 một thời gian rồi thì có thể sử dụng method array.filter()