YAHOO.lang.merge
YAHOO.lang.merge
allows you to combine any number of input objects and output a single merged set.
Click the Merge button to generate the merged set.
set1 = { foo : "foo" };
set2 = { foo : "BAR", bar : "bar" };
set3 = { foo : "FOO", baz : "BAZ" };
click Merge
YAHOO.lang
comes bundled with the YAHOO Global Object.
If you are using any other YUI component on your page, you should already have YAHOO.lang
available.
In the example illustrated above, we merge three object literals in the form of hash tables. Note the key values in later parameters override those in previous parameters.
You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.
Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings