判斷JS對象是否擁有某屬性的方法 1.in 運算符方法 對象的自有屬性或繼承屬性中包含這個屬性則返回true; 無論是key值name,還是原形鏈上的toString,都能檢測到返回true。 2.hasOwnPr ...