dictionary.mergeFromGlobal()

dictionary.mergeFromGlobal()
Returns: dictionary

Description:  Used to retrieve the values from the global scope and merge it over the local scope.

If a key is already present in the local scope with a different value it will be overridden by the value in the global scope.

Example

 // consider that global is {test: "test"}
var testDictionary = klevu.dictionary("test");
 testDictionary.getElements(); // {}
 testDictionary.addElement("test","testing");
 testDictionary.getElements(); // {test: "testing"}
 testDictionary.mergeFromGlobal();
 testDictionary.getElements(); // {test: "test"}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>