🧭Static Method
Think of it like
It is like a school bell. It belongs to the whole school, not to one child.
Example
Definition
Example code
javascript
class Temp {
static toF(c) { return c * 9 / 5 + 32; }
}
console.log(Temp.toF(20));
// 68It is like a school bell. It belongs to the whole school, not to one child.
class Temp {
static toF(c) { return c * 9 / 5 + 32; }
}
console.log(Temp.toF(20));
// 68