diff --git a/index.js b/index.js index 426017b..5c94679 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,9 @@ var hasOwnProperty = Object.prototype.hasOwnProperty; var indexOf = typeof Array.prototype.indexOf === 'function' ? function(arr, el) { return arr.indexOf(el); } : function(arr, el) { + if (typeof arr == 'string' && typeof "a"[0] == 'undefined') { + arr = arr.split(''); + } for (var i = 0; i < arr.length; i++) { if (arr[i] === el) return i; }