Javascript examples for Array:isArray
Check if input is an array with Array.isArray()
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// ww w . j av a 2s. c o m function draw(params) { if (!Array.isArray(params)) return; var inner = ''; params.map(function(param) { inner += param + '<br>'; }); document.body.innerHTML += inner; } draw(['hey', 'there']); } </script> </head> <body> </body> </html>