repl.txt (1044B)
1 2 {{alias}}( obj, fcn[, thisArg] ) 3 Invokes a function for each own and inherited enumerable property of an 4 object. 5 6 When invoked, the function is provided three arguments: 7 8 - `value`: object property value 9 - `key`: object property 10 - `obj`: the input object 11 12 To terminate iteration before visiting all properties, the provided function 13 must explicitly return `false`. 14 15 Property iteration order is *not* guaranteed. 16 17 Parameters 18 ---------- 19 obj: Object 20 Input object, including arrays, typed arrays, and other collections. 21 22 fcn: Function 23 The function to invoke for each own enumerable property. 24 25 thisArg: any (optional) 26 Execution context. 27 28 Returns 29 ------- 30 out: Object 31 Input object. 32 33 Examples 34 -------- 35 > function logger( v, k ) { console.log( '%s: %d', k, v ); }; 36 > function Foo() { return this; }; 37 > Foo.prototype.beep = 'boop'; 38 > var obj = new Foo(); 39 > {{alias}}( obj, logger ) 40 beep: boop 41 42 See Also 43 -------- 44