Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
345 views
in Technique[技术] by (71.8m points)

javascript - 检查键是否存在于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?

(还是抛出错误?)

  ask by Adam Ernst translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...