This is my code:
var Placemat = function(id,id2) {
this.hand = document.getElementById(id);
this.bucket = "";
this.bucketspace = document.getElementById(id2);
this.bucketvalue = 0;
var that = this;
this.deal = function(id) {
shuffle();
var card1 = deck.shift();
var card2 = deck.shift();
this.hand.innerHTML = card1 + ", " + card2;
};
this.hit = function(id2) {
var card3 = deck.shift();
this.bucket = this.bucket + deck.shift();
this.bucketspace.innerHTML = this.bucket;
};
};
Is this the proper way to pass parameters to a nested function? This id and id2 in this.deal() and this.hit() are from Placemat().