I recently stumbled upon this code and cannot understand how it works. Tell me please.

var Fn = function () { // … } Fn.set = function () { // … } 
  • four
    You should read some JS literature. This language is very different from other languages ​​and its code is not very familiar. In short, JS went very far in the sentence "everything is an object." The function is the same object as everything else in the language and it can have its own properties and methods. And still function can be not only object, but also a class (from the point of view of other OOP languages) - Mike
  • @Mike, thanks for the help. - Ivan Zadvornov
  • learn.javascript.ru - qwabra

0