84669 Lernen von Personen
152542 Lernen von Personen
20005 Lernen von Personen
5487 Lernen von Personen
7821 Lernen von Personen
359900 Lernen von Personen
3350 Lernen von Personen
180660 Lernen von Personen
48569 Lernen von Personen
18603 Lernen von Personen
40936 Lernen von Personen
1549 Lernen von Personen
1183 Lernen von Personen
32909 Lernen von Personen
不应该是报错么?
认证0级讲师
未初始化的全局变量和实例变量,默认值都是nil。可以看看文档:http://www.rubyist.net/~slage...
Before initialization, a global variable has the special value nil.
http://www.rubyist.net/~slage...
instance variables have the nil value until they are initialized.
访问没有初始化的变量返回nil,nil就可以看做是错误了。
为什么?因为方便,动不动就报错还要去处理多麻烦。还有你是个牛逼的程序员,有能力用好编程语言,不会因为nil把程序搞砸的(๑•̀ㅂ•́)و✧,所以我就不报错啦。
未初始化的全局变量和实例变量,默认值都是nil。
可以看看文档:
http://www.rubyist.net/~slage...
http://www.rubyist.net/~slage...
访问没有初始化的变量返回nil,nil就可以看做是错误了。
为什么?因为方便,动不动就报错还要去处理多麻烦。还有你是个牛逼的程序员,有能力用好编程语言,不会因为nil把程序搞砸的(๑•̀ㅂ•́)و✧,所以我就不报错啦。