我在Ruby on Rails入门经典上看到===是给case when的条件作判断用的
但我用以下代码测试并未觉得有何不同:
months="January","February","March","April","May","June","July","August","October","December"
0.upto 11 do
|month|
case
when 9==month
months[8,0]="September"
when 11==month
months[10,0]="November"
end
puts months
end
同样,用下列代码测试也很正常:
if(3===3)
puts 3
end
它们两者究竟有什么区别,望不吝赐教,谢谢!
晕死,应该发在“其他编程语言”里……
哈士奇WWW
相关分类