最近破坏了我的代码的是我天真地认为:
'+' in ['+','-',...] = true
。
唯一的问题是它实际上评估为 false!
请有人帮我理解这里发生了什么!
最佳答案
The in operator returns true if the specified property is in the specified object or its prototype chain.
来源:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in
关于javascript - JavaScript 中的 'in' 函数是怎么回事?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57977581/