Javascript Public Private Dichotomy