檢查鍵是否存在於JavaScript對象中? - Checking if a key exists in a JavaScript object?

問題:

How do I check if a particular key exists in a JavaScript object or array? 如何檢查JavaScript對象或數組中是否存在特定鍵? 數組

If a key doesn't exist, and I try to access it, will it return false? 若是密鑰不存在,而我嘗試訪問它,它將返回false嗎? Or throw an error? 仍是拋出錯誤? spa


解決方案:

參考一: https://stackoom.com/question/4beK/檢查鍵是否存在於JavaScript對象中
參考二: https://oldbug.net/q/4beK/Checking-if-a-key-exists-in-a-JavaScript-object
相關文章
相關標籤/搜索