It is unsafe to use this in an object's properties
It may contain potential bugs
const obj = {
name: 'foo',
foo() {
return this.name
}
}
obj.foo() // 'foo'
const foo = obj.foo;
foo() // ''
const obj = {
name: 'foo',
foo() {
return this.name
}
}
const obj = {
name: 'foo',
foo() {
return obj.name
}
}
no-this-in-object-expression
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too