简体   繁体   中英

Getting no-return-assign lint error for filteredArray.forEach((x) => (x.order -= 1)

I used filteredArray.forEach((x) => (x.order -= 1)); in order to decrement by 1 the order field for all the elements stored in filteredArray. Now I am getting the lint error: Arrow function should not return assignment no-return-assign

您只需将()更改为{}

filteredArray.forEach((x) => {x.order -= 1});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM