如何使用jQuery从JSON对象中删除值列表到另一个JSON对象

时间:2021-10-02 20:10:35

I have two JSON Objects:

我有两个JSON对象:

var A = { 'Header','Quotes','Returns','Indent','Basic',...,'Placing' }
var B = { 'Header','Quotes','Returns','Indent',... }

A and B share the same elements, Header, Quotes, Returns and Indent and so I need to remove them using jQuery.

A和B共享相同的元素,Header,Quotes,Returns和Indent,所以我需要使用jQuery删除它们。

A's Final Output should be:

A的最终输出应该是:

A = { 'Basic','Placing',... }

1 个解决方案

#1


You can use merge function:

您可以使用合并功能:

var A={'Header','Quotes','Returns','indent','Basic','Placing'}
Var B={'Header','Quotes','Returns','indent'}

var A = {'Header','Quotes','Returns','indent','Basic','Placing'} Var B = {'Header','Quotes','Returns','indent'}

var C = $.merge(A, B);

var C = $ .merge(A,B);

Regards

#1


You can use merge function:

您可以使用合并功能:

var A={'Header','Quotes','Returns','indent','Basic','Placing'}
Var B={'Header','Quotes','Returns','indent'}

var A = {'Header','Quotes','Returns','indent','Basic','Placing'} Var B = {'Header','Quotes','Returns','indent'}

var C = $.merge(A, B);

var C = $ .merge(A,B);

Regards