Language helpers are a set of jQuery plugins. They are described in the following sections.
The $.Object
plugin
contains the following three useful methods:
same
: It compares two objectssubset
: It checks if an object is a set of another objectsubsets
: It returns the subsets of an object
The same
method can
compare two objects. It supports nested objects. We can also specify if the comparison is case sensitive or if we can skip a particular property comparison.
Let's paste the following code into the jquerymx_object.js
file:
steal( 'jquery/lang/object', function ($) { window.object_1 = { property_1: 'foo', property_2: { property_1: 'bar', property_2: { property_1: 'Hello JMVC!' } } }; window.object_2 = { property_1: 'foo', property_2: { property_1: 'bar', property_2: { ...