I am a little confused between both of the below in codeacademy examples and want to understand well & know:
- What is the difference between both?
- Is there a time I should use one instead the other?
For Example:
array = [1,2,3,4,5]
array.each do |x|
x += 10
print x #thats what I mean x only not "{x}" as below
end
array = [1,2,3,4,5]
array.each do |x|
x += 10
print "#{x}"
end
Is that because they consider to add it as variable with string??