Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定のキーが連想配列に含まれているかどうかを確認する方法は? すべてのキーをループできることはわかっていますが、シングルステップ チェックを行うことはできますか?
myObject.hasOwnProperty("field")
コード例:
var dic:Object = new Object(); dic["field"] = "data"; trace (dic.hasOwnProperty("field")); //true trace (dic.hasOwnProperty("nofield")); //false