我在一个函数中定义了一个名为
我不知道为什么我总是会遇到以下错误:
reason
的 JavaScript 对象变量,随后用这个对象来定义属性,具体如下:$scope.upsertReason = function() {
var reason = {},
reason.reasons = [],
reason.scholarships = [];
}
我不知道为什么我总是会遇到以下错误:
412 | reason.reasons = [],
^ 'reason' is already defined.
412 | reason.reasons = [],
^ Missing semicolon.
412 | reason.reasons = [],
^ Expected an identifier and instead saw '.'.
412 | reason.reasons = [],
^ Expected an assignment or function call and instead saw an expression.
412 | reason.reasons = [],
^ Missing semicolon.
413 | reason.scholarships = [];
^ Expected an assignment or function
我已经确认在代码中没有定义reason
变量。需要帮助,谢谢。