0

intArr.length function shouldn't br intArr.length();

31st Dec 2016, 3:29 PM
Gagan Kalra
Gagan Kalra - avatar
4 Respuestas
+ 3
for array it's .length. for string it's .length ()
31st Dec 2016, 4:17 PM
Kamil
Kamil - avatar
+ 3
array is not an object so a method won't work that's why we have .length, a string is an object so we need a method => .length ()
31st Dec 2016, 4:22 PM
Kamil
Kamil - avatar
0
why so ?
31st Dec 2016, 4:17 PM
Gagan Kalra
Gagan Kalra - avatar
0
oohh yes I knew about string as a class but not array thanks
31st Dec 2016, 4:29 PM
Gagan Kalra
Gagan Kalra - avatar