问题在下面,indexOf返回-1,尽管我已经检查过,{quote: quote, value: localStorage[quote]}与列表中的元素是完全相同的值。stated in a function where the quote var has the same value as quote var above
var index = $scope.stats.indexOf
我目前正在向数组中添加一个WebSocket客户端对象,以便将它(按索引)匹配到另一个用户信息数组,以确定哪个用户属于哪个客户机/套接字/会话。= [];wss.on('connection', function connection(ws) {
var i = clients.indexOf(它返回0),因此我能够将该对象作为JSON对象的一部分插入到"users“