✏️ 编辑:tap.js
路径:
/home/boguraj1/public_html/jobsite/node_modules/lodash/tap.js
大小:703 B · 修改:2022-11-21 20:09:56 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
/** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } module.exports = tap;
💾 保存
取消
保存为 UTF-8,换行统一为 LF