Skip to content

Dexie.getByKeyPath()

David Fahlander edited this page May 6, 2014 · 2 revisions

Retrieve a property from an object given a key path.

Sample

var obj = {
    name: "Kalle",
    address: {
        street: "East 13th Street",
        city: "New York"
    }
};

alert (Dexie.getByKeyPath(obj, "name")); // Will alert ("Kalle");
alert (Dexie.getByKeyPath(obj, "address.street")); // Will alert ("East 13th Street");
Clone this wiki locally