a = {"a":1,"c":2}
p a
unless a[:a]
p "unless a"
end
unless a[:cc]
p "unless cc"
end
if a[:a]
p "a ok"
end
if a[:cc]
p "cc ok"
end
{:a=>1, :c=>2}
"unless cc"
"a ok"
Go to list of users who liked
More than 1 year has passed since last update.
a = {"a":1,"c":2}
p a
unless a[:a]
p "unless a"
end
unless a[:cc]
p "unless cc"
end
if a[:a]
p "a ok"
end
if a[:cc]
p "cc ok"
end
{:a=>1, :c=>2}
"unless cc"
"a ok"
Register as a new user and use Qiita more conveniently
Go to list of users who liked