My code:
class DoIt {
city () {
// others operations...
const number = 5; // from operations
const amount = this.getAmount (number);
// others operations...
}
street () {
// others operations...
const number = 10; // from operations
const amount = this.getAmount (number);
// others operations...
}
getAmount (number) {
return number * 10 * 3.14 / 3; // example...
}
}
I use "eslint" to check my code and I have error:
error Expected 'this' to be used by class method 'getAmount' class-methods-use-this
So where to put a method without "this"? This code is important for my class, so I shouldn't create helper class...
Maybe this method is not important? In OOP in other languages can exists method without 'this' in class methods?