<script> var arr=new Array(); var obj={'1':2}; var num=11; function isType(obj){ if(obj instanceof Array) return 'Array'; else if(obj instanceof Object) return 'Object'; else return 'notObj' } console.log(isType(arr)); console.log(isType(obj)); console.log(isType(num));; </script>