Calls the provided callbackFn once for each own enumerable key (string and symbol) in the
supplied value. The callback can stop iteration early by returning -1.
This helper works with plain objects, arrays, and functions while safely ignoring
null and undefined values.
Note: Unlike objForEachKey, this helper also iterates enumerable symbol keys via
Object.getOwnPropertySymbols. Use forEachOwnKeySafe when iterating untrusted input
to filter out unsafe keys like __proto__, constructor, and prototype.
Calls the provided
callbackFnonce for each own enumerable key (string and symbol) in the supplied value. The callback can stop iteration early by returning-1.This helper works with plain objects, arrays, and functions while safely ignoring
nullandundefinedvalues.Note: Unlike objForEachKey, this helper also iterates enumerable symbol keys via
Object.getOwnPropertySymbols. Use forEachOwnKeySafe when iterating untrusted input to filter out unsafe keys like__proto__,constructor, andprototype.