In the same way that dojo has array functions that provide forEach and map functions to older browsers, does the Dojo Toolkit offer a solution for Object.keys and Object.values?
I think you might be looking for dojox/lang/functional/object
, which contains methods to get an object's keys and values. Since the documentation is pretty lacking, here's a fiddle.
require([
'dojox/lang/functional/object'
], function(o) {
var obj = {
key: 'value1',
name: 'myName',
numeric: 1,
'hello': 'there'
};
console.log(o.keys(obj));
console.log(o.values(obj));
});
There are also functions to filter
, map
, and iterate each attribute in (forEach
) objects in that module.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With