How to copy/clone a hash/object in JQuery?

前端 未结 6 2162
既然无缘
既然无缘 2021-02-05 00:52

I have a simple object (or hash) in Javascript:

var settings = {
  link: \'http://example.com\',
  photo: \'http://photos.com/me.jpg\'
};

I nee

6条回答
  •  终归单人心
    2021-02-05 01:51

    It sounds like you want jQuery extend, which can copy an object for you.

    http://api.jquery.com/jQuery.extend/

提交回复
热议问题