js encapsulation demo