JavaScript function considered a first-class object
Monday, 26. November 2007
JavaScript is a prototype based language, and it has many characteristics of functional languages. For example, JavaScript regards a function as a first-class object. Among many type checking functions YUI provides, YAHOO.lang.isObject() reflects the characterstic.
<script src="http://yui.yahooapis.com/2.3.1/build/yahoo/yahoo-min.js" type="text/javascript"></script>
foo= function() {} // function is storable in variables
YAHOO.lang.isObject(foo) // returns true
