updated example with latest js features.