Add new element to an existing object

后端 未结 6 1809
走了就别回头了
走了就别回头了 2020-12-13 12:41

I was looking for a way to add new elements to an an existing object like what push does with arrays

I have tried this and it didn\'t work :

var myF         


        
6条回答
  •  旧巷少年郎
    2020-12-13 13:15

    You are looking for the jQuery extend method. This will allow you to add other members to your already created JS object.

提交回复
热议问题