|
|
|
|
|
by nostalgeek
2998 days ago
|
|
class Foo {
Bar(){}
}
and a list of methods is in my opinion more readable than function Foo{}
Foo.prototype.Bar =function(){}
As for "avoid this". Really? this is part of Javascript, developers should understand it instead of "avoiding" it.> It is rarely required and most anything can be achieved with very basic JS objects and functions which are simpler to work with, easier to reason about and easier to write tests for. This is straight out false. It's no harder to "reason about" or "to write tests for". I get the impression that a tiny group of people are trying to push these ideas desperately for whatever reason, but it makes no sense, you're not the custodians of the language. |
|
People usually share these thoughts, not out of desperation or ulterior motive, but because they've had experience with many paradigms and they've found these the most effective.