Are Interfaces in JavaScript necessary?

前端 未结 5 1076
再見小時候
再見小時候 2021-02-04 00:31

I suppose this could apply to any dynamic language, but the one I\'m using is JavaScript. We have a situation where we\'re writing a couple of controls in JavaScript that need t

5条回答
  •  遇见更好的自我
    2021-02-04 01:16

    Dynamic languages often encourage Duck Typing, in which methods of the object dictate how it should be used rather than an explicit contract (such as an interface).

提交回复
热议问题