--- robots: noindex, nofollow tags: refactoring --- # Loops ![](https://i.imgur.com/IXglYGw.jpg) ## 徵兆與症狀 迴圈內的簡易操作,其實可以用單一 function 來表達,並且用 map、filter、reduce 來簡化寫作。 ## 出現原因 當時所使用的程式語言不支援 `first-class function`。 ## 處理方法 - 使用 `Replace Loops with Pipeline` 來取代以往的迴圈操作。