How do you check for the type of variable in Elixir

前端 未结 8 1287
走了就别回头了
走了就别回头了 2021-01-30 15:25

In Elixir how do you check for type such as in Python:

>>> a = \"test\"
>>> type(a)

>>> b =10
>>> type(b         


        
8条回答
  •  遇见更好的自我
    2021-01-30 15:48

    Just because nobody has mentioned it

    IO.inspect/1

    Outputs to console the object ... its almost equiv to JSON.stringify

    Very helpful when you just cannot for the life of you figure out what an object looks like in a test.

提交回复
热议问题