Using a class object in case statement

后端 未结 4 1254
梦如初夏
梦如初夏 2020-12-15 09:09

What is the best way to use a class object in case statement? Suppose I have a which is an instance of the Class class. I want to match it against

4条回答
  •  暖寄归人
    2020-12-15 09:37

    Because

    Array === Array # return false
    

    and "case when" means "===", so you meet the problem.

提交回复
热议问题