/*
---
description: A generic method to check the length of any type of variable.

license: MIT-style

authors:
- Arieh Glazer

requires:
- core/1.2.4 : [Core]

provides: [$count]

...
*/
function $count(a){if(!a){return 0}switch($type(a)){case"number":return a;case"function":return(a+"").split("{")[1].test(/[\w]+/)?0:1;case"object":return $H(a).getLength();case"window":case"document":case"element":return a.getChildren().length}return((a.length)?a.length:($type(+a))?+a:1)};
