rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
15 lines • 411 B
JavaScript
/**
* @public
* Like `Array.forEach` but for arbitrary objects.
*
* @remarks
* See {@link dictionaryForEach}.
*/
export function dictionaryForEach(dictionary, callback) {
const keys = Object.keys(dictionary);
for (let i = 0, iEnd = keys.length; i < iEnd; ++i) {
const key = keys[i];
callback(dictionary[key], key, dictionary);
}
}
//# sourceMappingURL=dictionary-foreach.js.map