Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ie compatibility

  • Loading branch information...
commit 313a64074d6c532bb275e97c7c98ad357a7480ec 1 parent f6038f8
@jkk authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 index.html
View
11 index.html
@@ -78,9 +78,16 @@
return html;
}
+ function indexOf(arr, needle) {
+ for (var i = 0; i < arr.length; i++)
+ if (arr[i] === needle)
+ return i;
+ return -1;
+ }
+
function getCardIndex() {
- var index;
- while (typeof index == 'undefined' || pickedCardIndexes.indexOf(index) != -1)
+ var index = -1;
+ while (index == -1 || indexOf(pickedCardIndexes, index) != -1)
index = Math.floor(Math.random() * deck.length);
pickedCardIndexes.push(index);
return index;
Please sign in to comment.
Something went wrong with that request. Please try again.