This method is like `forEach` except that it iterates over elements of `collection` from right to left.
forEachRight([1, 2], value => console.log(value))
// => Logs `2` then `1`.
| Name | Type | Attribute | Description |
|---|---|---|---|
| collection | The collection to iterate over. | ||
| iteratee | The function invoked per iteration. |
{
"comment": "/**\r\n * This method is like `forEach` except that it iterates over elements of\r\n * `collection` from right to left.\r\n *\r\n * @since 2.0.0\r\n * @alias eachRight\r\n * @category Collection\r\n * @param {Array|Object} collection The collection to iterate over.\r\n * @param {Function} iteratee The function invoked per iteration.\r\n * @returns {Array|Object} Returns `collection`.\r\n * @see forEach, forIn, forInRight, forOwn, forOwnRight\r\n * @example\r\n *\r\n * forEachRight([1, 2], value => console.log(value))\r\n * // => Logs `2` then `1`.\r\n */",
"meta": {
"range": [
652,
812
],
"filename": "forEachRight.js",
"lineno": 20,
"path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
"code": {
"id": "astnode100002926",
"name": "forEachRight",
"type": "FunctionDeclaration",
"paramnames": [
"collection",
"iteratee"
]
},
"vars": {
"func": "eachRight~func"
}
},
"description": "This method is like `forEach` except that it iterates over elements of\r`collection` from right to left.",
"since": "2.0.0",
"alias": "eachRight",
"tags": [
{
"originalTitle": "category",
"title": "category",
"text": "Collection",
"value": "Collection"
}
],
"params": [
{
"type": {
"names": [
"Array",
"Object"
]
},
"description": "The collection to iterate over.",
"name": "collection"
},
{
"type": {
"names": [
"function"
]
},
"description": "The function invoked per iteration.",
"name": "iteratee"
}
],
"returns": [
{
"type": {
"names": [
"Array",
"Object"
]
},
"description": "Returns `collection`."
}
],
"see": [
"forEach, forIn, forInRight, forOwn, forOwnRight"
],
"examples": [
"forEachRight([1, 2], value => console.log(value))\r// => Logs `2` then `1`."
],
"name": "eachRight",
"longname": "eachRight",
"kind": "function",
"scope": "global",
"___id": "T000002R000312",
"___s": true,
"filepath": "forEachRight.js"
}