Skip to content

Instantly share code, notes, and snippets.

@ainame ainame/bug.rb
Created Oct 10, 2014

Embed
What would you like to do?
user = {
id: 1,
name: 'ainame',
}
if flag
user[:gender] = 'male', # ← 末尾にカンマが入ってしまっていたけどシンタックスエラーにはならない
user[:age] = 100
end
# user[:gender] #=> ['male', 100]
# user[:age] #=> 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.