S
Simbolla Simbolla
Hi all,
Below is my code
h={}
arr=[]
def gethash
h[1]=0
return h
end
arr[0]=gethash
puts arr[0].each {|k,v| puts "key #{k} value #{v}"}
For the above i get error saying "Undifined local variable or method 'h'
for main:Object(NameError)"
may i know reason for this error?
Below is my code
h={}
arr=[]
def gethash
h[1]=0
return h
end
arr[0]=gethash
puts arr[0].each {|k,v| puts "key #{k} value #{v}"}
For the above i get error saying "Undifined local variable or method 'h'
for main:Object(NameError)"
may i know reason for this error?