The public facing server has a higher risk of being hacked or attacked. So, you may want to minimize the risk by following the steps mentioned in this article.
JavaScript allows developer to declare object dynamically at runtime. On the other hande, it has 'class' keyword for declaring object type to be used in conjunction with 'instanceof'.