📜  长生不老药卫士 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:23.608000             🧑  作者: Mango

代码示例1
defmodule Guard do
  def kind_of(x) when is_binary(x) do
    "#{x} is a binary"
  end

  def kind_of(x) when is_atom(x) do
    "#{x} is an atom"
  end

  def is_ten(x) when x > 10, do: "Greater than ten"

  def is_ten(x) when x < 10, do: "Less than ten"

  def is_ten(x), do: "Yes"
end