MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / forIn

Function forIn

scripts/libs/utils/object.js:34–41  ·  view source on GitHub ↗
(obj, fn)

Source from the content-addressed store, hash-verified

32
33/* Traverse an object without including its properties on the prototype chain */
34export function forIn(obj, fn) {
35 fn = fn || function () {};
36 for (var key in obj) {
37 if (Object.hasOwnProperty.call(obj, key)) {
38 fn(key, obj[key]);
39 }
40 }
41}
42
43/* Get the key value of the object. ES6+ applications can use Object.keys() instead */
44export function getObjKeys(obj) {

Callers 2

getObjKeysFunction · 0.85
deepMergeFunction · 0.85

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected