elixir KERNEL 2 Flashcards
(54 cards)
is_map(%{})
=> true
What type of Error raised when executing? not nil
ArgumentError
*Note: Arguments must be a boolean
length([a: 1, b: 2])
=> 2
hd([5, 6, 7])
=> 5
is_float(1.2)
=> true
What type of Error raised when executing?
elem({}, 0)
ArgumentError
is_map(%Range{})
=> true
true and “hello”
=> “hello”
is_nil(nil)
=> true
to_string(12.3)
=> “12.3”
false and “hello”
=> false
rem(8, -7)
=> 1
elem({1, 2, :hello}, 1)
=> 2
apply(Kernel, :byte_size, [“cat”])
=> 3
is_function(fn(x) -> x + 1 end)
=> true
is_integer(28) == is_number(2.7)
=> true
tuple = {:clever, “bunny”}
put_elem(tuple, 0, “funny”)
=> {“funny”, “bunny”}
inspect(:hello)
=> “:hello”
byte_size(«1, 2»)
=> 2
inspect(‘bar’)
=> “‘bar’”
not false
=> true
inspect [1, 2, 3], limit: 2
=> “[1, 2, …]”
self() |> is_pid()
=> true
iex> x = 1
iex> binding()
iex => [x: 1]
*Note: Returns the binding for the given context as a keyword list