Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

prevent creating a second global

  • Loading branch information...
commit f2f18b52b4c3b196adf5af70c997b72792b0b05a 1 parent c8818e1
@madrobby authored
Showing with 7 additions and 4 deletions.
  1. +1 −0  .gitignore
  2. +6 −4 creditcard.js
View
1  .gitignore
@@ -0,0 +1 @@
+.DS_Store
View
10 creditcard.js
@@ -69,7 +69,9 @@ var CreditCard = {
}
};
-for(card in CreditCard.CARDS)
- CreditCard['is'+card] = function(card, number){
- return CreditCard.CARDS[card].test(CreditCard.strip(number));
- }.curry(card);
+(function(){
+ for(var card in CreditCard.CARDS)
+ CreditCard['is'+card] = function(card, number){
+ return CreditCard.CARDS[card].test(CreditCard.strip(number));
+ }.curry(card);
+})();

0 comments on commit f2f18b5

Please sign in to comment.
Something went wrong with that request. Please try again.