dynamic object construction in javascript?

后端 未结 4 1502
日久生厌
日久生厌 2020-12-01 11:08

When I want to call a function in javascript with arguments supplied from elsewhere I can use the apply method of the function like:

array = [&qu         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 11:26

    I think another way of achieving this could be to extend the Ext Template class so that the constructor of the new object takes your array and does the stuff you want to do. This way all the constructing stuff would be done for you and you could just call the constructor of your superclass with your arguments.

提交回复
热议问题