我有5次以下错误:
未捕获的 ReferenceError:后缀操作中的左侧表达式无效
你们明白为什么吗?感谢你的帮助 !
toQueryParams: function (string, separator) {
var match = _(string).strip().match(/([^?#]*)(#.*)?$/);
if (!match) return {};
return _(match[1].split(separator || '&')).reduce(function (hash, pair) {
if ((pair = pair.split('='))[0]) {
var key = decodeURIComponent(pair.shift()),
value = pair.length > 1 ? pair.join('=') : pair[0];
if (value != undefined) value = decodeURIComponent(value);
if (key in hash) {
if (!_.isArray(hash[key])) hash[key] = [hash[key]];
hash[key].push(value);
}
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
else hash[key] = value;
}
return hash;
}, {});
},