This method is like `forOwn` except that it iterates over properties of `object` in the opposite order.
function Foo() {
this.a = 1
this.b = 2
}
Foo.prototype.c = 3
forOwnRight(new Foo, function(value, key) {
console.log(key)
})
// => Logs 'b' then 'a' assuming `forOwn` logs 'a' then 'b'.
| Name | Type | Attribute | Description |
|---|---|---|---|
| object | The object to iterate over. | ||
| iteratee | The function invoked per iteration. |
{
"comment": "/**\r\n * This method is like `forOwn` except that it iterates over properties of\r\n * `object` in the opposite order.\r\n *\r\n * @since 2.0.0\r\n * @category Object\r\n * @param {Object} object The object to iterate over.\r\n * @param {Function} iteratee The function invoked per iteration.\r\n * @returns {Object} Returns `object`.\r\n * @see forEach, forEachRight, forIn, forInRight, forOwn\r\n * @example\r\n *\r\n * function Foo() {\r\n * this.a = 1\r\n * this.b = 2\r\n * }\r\n *\r\n * Foo.prototype.c = 3\r\n *\r\n * forOwnRight(new Foo, function(value, key) {\r\n * console.log(key)\r\n * })\r\n * // => Logs 'b' then 'a' assuming `forOwn` logs 'a' then 'b'.\r\n */",
"meta": {
"range": [
637,
870
],
"filename": "forOwnRight.js",
"lineno": 25,
"path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
"code": {
"id": "astnode100002983",
"name": "forOwnRight",
"type": "FunctionDeclaration",
"paramnames": [
"object",
"iteratee"
]
},
"vars": {
"props": "forOwnRight~props",
"length": "forOwnRight~length"
}
},
"description": "This method is like `forOwn` except that it iterates over properties of\r`object` in the opposite order.",
"since": "2.0.0",
"tags": [
{
"originalTitle": "category",
"title": "category",
"text": "Object",
"value": "Object"
}
],
"params": [
{
"type": {
"names": [
"Object"
]
},
"description": "The object to iterate over.",
"name": "object"
},
{
"type": {
"names": [
"function"
]
},
"description": "The function invoked per iteration.",
"name": "iteratee"
}
],
"returns": [
{
"type": {
"names": [
"Object"
]
},
"description": "Returns `object`."
}
],
"see": [
"forEach, forEachRight, forIn, forInRight, forOwn"
],
"examples": [
"function Foo() {\r this.a = 1\r this.b = 2\r}\r\rFoo.prototype.c = 3\r\rforOwnRight(new Foo, function(value, key) {\r console.log(key)\r})\r// => Logs 'b' then 'a' assuming `forOwn` logs 'a' then 'b'."
],
"name": "forOwnRight",
"longname": "forOwnRight",
"kind": "function",
"scope": "global",
"___id": "T000002R000317",
"___s": true,
"filepath": "forOwnRight.js"
}