check if literal object included in other object with Built-in API

I mean Object-B is included in Object-A , when all attributes of Object-B are included in the object-A & its values are the same in the object-A .

 var obj_b={a:1,d:3}   var obj_a={a:1,b:22,c:33,d:3} //--> obj_b includes in obj_a   var obj_c={a:1,f:4};    isIncluded=(small,big)=>Object.keys(small).every((k)=>big[k] === small[k])  console.log(   'Does "obj-b" included in "obj-a"  ? ',isIncluded(obj_b,obj_a)     )  console.log(   'Does "obj-c" included in "obj-a"  ? ',isIncluded(obj_c,obj_a)     )

My question is :

Does ES6/ES7 has built-in API more elegant & brief for that ?

For example , to extend object from origin , ES6 brought Object.assign(o1,o2) ?

Is there something like Object.isInclude(o1,o2)


Category: javascript Time: 2016-07-30 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.122 (s). 12 q(s)