Returns the length of the supplied item. The function can be applied to various different datatypes, as illustrated below:
:-) var list = newList( 1, 2, 3, 4 );
There are 0 results
:-) list.length;
There is 1 result
4
:-) var map = newMap( "hello" ==> "there", "whats" ==> "that" );
There are 0 results
:-) map.length;
There is 1 result
2
:-) "A string".length;
There is 1 result
8
:-) var maplet = newMaplet( "key", "value" );
There are 0 results
:-) maplet.length;
There is 1 result
2
:-) var xml = <element>"hello", 2, <blah><child/></blah>, 72, "what"</element>
There are 0 results
:-) xml.length;
There is 1 result
5
It's also worth noting that MillScript can also operate with any other Java objects and the length function can be applied to them. The only clause is that the objects must implement one of the following interfaces: Collection, List, Map or Map.Entry