[removed] Different return types

后端 未结 3 594
余生分开走
余生分开走 2021-01-18 01:20

I saw I could return different types from the same function in JavaScript. Is this practice idiomatic or should it be discouraged?

For example:

somef         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 02:07

    it is very common that one function return different types of object in javascript, just write it, invoke it and determine the type of return value.

提交回复
热议问题