最佳答案
启动解释器/控制台并尝试进行比较
> ",,," == Array(4)
True
为什么?一开始我想,也许因为您可以将“ ,,”想象成一个包含4个字符的数组,其中有一个’0’结束切片,这可能就是原因,但是
> "..." == Array(4)
Returns "False". So... why? I know it's some idiosyncratic bit of duck typing in Javascript, but just curious what underlines this behavior. Gleaned this from Zed Shaw's excellent 顺便说一下.