javascript 走訪物件屬性

for (const prop in obj)
    if (Object.prototype.hasOwnProperty.call(obj, prop)) 
        console.log(obj[prop]);

留言

熱門文章