Is substring() method available in the String object in non global scope?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2015 02:19 AM
I am using below code in some non global application scope
current.floor = parseInt(current.room.substring(0,1)); // where 'room' is string type and 'floor' is integer type.
but it is not working, i am getting error
but when i am using
current.floor = parseInt(current.room.toString().substring(0,1));
it is working perfectly fine.
Why do i need to use toString() for a string type variable?
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2015 05:37 AM
Yes thats the thing. I thing for the security issues they have restricted access.