Uncaught ReferenceError: Invalid left-hand side in assignment

简介: Uncaught ReferenceError: Invalid left-hand side in assignment

js的报错有时候会让人很难以琢磨


尝试给不能赋值的东西赋值,引起这个错误

if(doSomething() = 'somevalue')

此例中,程序员意外地使用了单个等号,而不是双等号。“left-hand side in assignment” 提及了等号左手边的部分,因此你可以看到以上例子,左手边包含不能赋值的东西,导致这个错误。


如何修复错误:确保没有给函数结果赋值,或者给 this 关键字赋值。


相关文章
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
|
8月前
|
开发工具
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
232 0
|
8月前
|
人工智能
L - MaratonIME doesn't like odd numbers
L - MaratonIME doesn't like odd numbers
ReferenceError: document is not defined
ReferenceError: document is not defined
62 0
ReferenceError: self is not defined
ReferenceError: self is not defined
523 0
|
JavaScript
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent .(二)
1.在data中声明一个变量接收props的值,然后再去改变data里的这个值 2. 用computed属性 3.用data保存数据,watch监听
108 0
|
JavaScript
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent .(一)
大致意思就是props接收到的从父组件传过来的tableData不能直接修改。
157 0
|
Dart 前端开发 JavaScript
Syntax Error: TypeError: this.getOptions is not a function
Syntax Error: TypeError: this.getOptions is not a function
554 0
Syntax Error: TypeError: this.getOptions is not a function
|
C语言
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
159 0
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
133 0