使用JS物件本身就內建的hasOwnProperty(),來檢視物件之內是否有()內的property,有個話回傳true,反之false。 例如:. myObj裡面有name這個property,所以true,.
確定! 回上一頁