{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/jquery/issues/2564","labels_url":"https://api.github.com/repos/jquery/jquery/issues/2564/labels{/name}","comments_url":"https://api.github.com/repos/jquery/jquery/issues/2564/comments","events_url":"https://api.github.com/repos/jquery/jquery/issues/2564/events","html_url":"https://github.com/jquery/jquery/issues/2564","id":104219835,"number":2564,"title":"How work $.extend method?","user":{"login":"cawa-93","id":1662812,"avatar_url":"https://avatars.githubusercontent.com/u/1662812?v=3","gravatar_id":"","url":"https://api.github.com/users/cawa-93","html_url":"https://github.com/cawa-93","followers_url":"https://api.github.com/users/cawa-93/followers","following_url":"https://api.github.com/users/cawa-93/following{/other_user}","gists_url":"https://api.github.com/users/cawa-93/gists{/gist_id}","starred_url":"https://api.github.com/users/cawa-93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cawa-93/subscriptions","organizations_url":"https://api.github.com/users/cawa-93/orgs","repos_url":"https://api.github.com/users/cawa-93/repos","events_url":"https://api.github.com/users/cawa-93/events{/privacy}","received_events_url":"https://api.github.com/users/cawa-93/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-01T09:03:19Z","updated_at":"2015-09-01T16:11:03Z","closed_at":"2015-09-01T12:38:47Z","body":"Code example:\r\n```javascript\r\n\tvar Popup = {\r\n\t\tAPI: {\r\n\t\t\tkey: 'some key',\r\n\t\t\tid: 1234\r\n\t\t},\r\n\t\tcallAPI: function (opt) {\r\n\t\t\treturn $.extend(true, {\r\n\t\t\t\turl: 'http://example.com/',\r\n\t\t\t\tdata: this.api\r\n\t\t\t}, opt);\r\n\t\t}\r\n\t};\r\n```\r\nAfter using the callAPI method property API also changes:\r\n```javascript\r\n>\tPopup.callAPI({\r\n\t\tdata:{\r\n\t\t\tmess:'some text'\r\n\t\t}\r\n\t});\r\n<      {\r\n\t\turl: 'http://example.com/',\r\n\t\tdata:  {\r\n\t\t\tkey: 'some key',\r\n\t\t\tid: 1234,\r\n\t\t\tmess:'some text'\r\n\t\t}\r\n\t}\r\n>\tPopup.API;\r\n<      {\r\n\t\tkey: 'some key',\r\n\t\tid: 1234,\r\n\t\tmess:'some text'\r\n\t}\r\n```\r\n\r\nUsing jQuery v2.1.4"},"comment":{"url":"https://api.github.com/repos/jquery/jquery/issues/comments/136776132","html_url":"https://github.com/jquery/jquery/issues/2564#issuecomment-136776132","issue_url":"https://api.github.com/repos/jquery/jquery/issues/2564","id":136776132,"user":{"login":"pyhedgehog","id":1286400,"avatar_url":"https://avatars.githubusercontent.com/u/1286400?v=3","gravatar_id":"","url":"https://api.github.com/users/pyhedgehog","html_url":"https://github.com/pyhedgehog","followers_url":"https://api.github.com/users/pyhedgehog/followers","following_url":"https://api.github.com/users/pyhedgehog/following{/other_user}","gists_url":"https://api.github.com/users/pyhedgehog/gists{/gist_id}","starred_url":"https://api.github.com/users/pyhedgehog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyhedgehog/subscriptions","organizations_url":"https://api.github.com/users/pyhedgehog/orgs","repos_url":"https://api.github.com/users/pyhedgehog/repos","events_url":"https://api.github.com/users/pyhedgehog/events{/privacy}","received_events_url":"https://api.github.com/users/pyhedgehog/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T16:11:03Z","updated_at":"2015-09-01T16:11:03Z","body":"Easiest way to copy `this.API` object in your case is:\r\n```JavaScript\r\n            return $.extend(true, {}, {\r\n                url: 'http://example.com/',\r\n                data: this.API\r\n            }, opt);\r\n```"}}