elixir KERNEL 2 Flashcards
1
Q
is_map(%{})
A
=> true
2
Q
What type of Error raised when executing? not nil
A
ArgumentError
*Note: Arguments must be a boolean
3
Q
length([a: 1, b: 2])
A
=> 2
4
Q
hd([5, 6, 7])
A
=> 5
5
Q
is_float(1.2)
A
=> true
6
Q
What type of Error raised when executing?
elem({}, 0)
A
ArgumentError
7
Q
is_map(%Range{})
A
=> true
8
Q
true and “hello”
A
=> “hello”
9
Q
is_nil(nil)
A
=> true
10
Q
to_string(12.3)
A
=> “12.3”
11
Q
false and “hello”
A
=> false
12
Q
rem(8, -7)
A
=> 1
13
Q
elem({1, 2, :hello}, 1)
A
=> 2
14
Q
apply(Kernel, :byte_size, [“cat”])
A
=> 3
15
Q
is_function(fn(x) -> x + 1 end)
A
=> true
16
Q
is_integer(28) == is_number(2.7)
A
=> true
17
Q
tuple = {:clever, “bunny”}
put_elem(tuple, 0, “funny”)
A
=> {“funny”, “bunny”}
18
Q
inspect(:hello)
A
=> “:hello”
19
Q
byte_size(«1, 2»)
A
=> 2
20
Q
inspect(‘bar’)
A
=> “‘bar’”
21
Q
not false
A
=> true