Advertisement
ivana_andreevska

Check if input is array

Dec 22nd, 2021
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var isArr=function(input)
  2. {
  3.     if(toString.call(input)==="[object Array]")
  4.     {
  5.         return true;
  6.     }
  7.     else
  8.     {
  9.         return false;
  10.     }
  11. };
  12.  
  13. console.log(isArr('ivana'));
  14. console.log(isArr([1,2,3,1]));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement