I have:
num = ["jack","sparrow","terminator","leonidus"]
name = "jack"
The solution is:
if num.include? name
puts " Jack is here"
else
puts " Invite jack"
end
# => "Jack is here"
My old script is:
val = num.include? name
if val == "true"
puts " Jack is here"
else
puts " Invite jack"
end
# => "Invite jack"
Why is my old script not working? What is wrong with it?