Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby **

# アスタリスク2つつけるとハッシュになる
def huga(**a) # def huga(a = {})と同意
  p a
end

huga(b:1,c:2)
#=> {:b=>1, :c=>2}

def huga_2(a)
  p a 
end
huga_2({a:1,b:2})
 
PREVIOUS NEXT
Tagged: #ruby
ADD COMMENT
Topic
Name
8+8 =