类型错误:无效的 Array.prototype.sort 参数
当 Array.prototype.sort()
的参数既不是 undefined
也不是比较其操作数的函数时,就会发生 JavaScript 异常 "无效的 Array.prototype.sort 参数"。
¥The JavaScript exception "invalid Array.prototype.sort argument" occurs when the argument of Array.prototype.sort()
isn't either undefined
or a function which compares its operands.
信息
错误类型
什么地方出了错?
¥What went wrong?
Array.prototype.sort()
的参数应该是 undefined
或比较其操作数的函数。
¥The argument of Array.prototype.sort()
is expected to be either undefined
or a function which compares its operands.
示例
无效案例
有效案例
也可以看看
¥See also