var arr = [4,6], obj = {k:5}; function liter(a){ if(a instanceof Array) return []; if(a instanceof Object) return {}; } console.log(liter(obj)); console.log(liter(arr));