1.0.0 • Published 9 years ago

isfunc v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

isfunc

A lightweight function allows to check if a JavaScript value is a function, with fallback solution for environments that return incorrect typeof operator results.

##Instllation

npm install isfunc

##Node/CommonJS

var isFunction = require('isfunc');
isFunction(isFunction);//true
isFunction(function(){});//true
isFunction('function');//false

##AMD

require(['isfunc'], function(isFunction){
  isFunction(isFunction);//true
  isFunction(function(){});//true
  isFunction('function');//false
});

##Global

<script src="isfunc/index.js"></script>
Function.isFunction(Array);//true
Function.isFunction(function(){});//true
Function.isFunction('function');//false