Use Array.isArray, instead of jQuery
Removed test code