By default in Javascript, all properties are made public. This means that at any point in the program, the properties can be accessed or changed.

In some cases that's what we want. But in our Blackjack game, it can get us in trouble. To see how, look at the code to the right. First, we have put in a sample Card constructor (without the getters), and then we have made a function cheat (line 21). It simply checks to see if there is a property called number, then changes the numbers of the two cards to 13 and 1 to get an ace and a king. Hit run to see that cheat does indeed work, automatically giving the player blackjack!

One important lesson of object-oriented design is to make things private when we can. In this case once a card is created and dealt out, we probably don't want to change what's on the card. That way, even if another function knows the name of our properties, they won't be able to change them from the outside!