Why is foreach better than get for Scala Options?

前端 未结 6 422
深忆病人
深忆病人 2021-01-31 07:31

Why using foreach, map, flatMap etc. are considered better than using get for Scala Options? If I useisEmpty I c

6条回答
  •  一向
    一向 (楼主)
    2021-01-31 08:19

    There are already excellent answers to the actual question, but for more Option-foo you should definitely check out Tony Morris' Option Cheat Sheet.

提交回复
热议问题