This only works for mutable operations on data structures. Image you use the filter function on the array (or map or reduce).
const{tap}=require('taptaptap');constarr=[1,2,3];constmappedArr=tap(arr).map(val=>val*2);mappedArr[0]===arr[0]// the value returned from the map function is the old array
This only works for mutable operations on data structures. Image you use the filter function on the array (or map or reduce).
Yup, unnecessary in such cases.