Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. const Application = (() => {
  2. const privateVariable = 'Private content'
  3. const link = document.querySelector('.link')
  4.  
  5. const _private = {
  6. cache: () => (this.link = document.querySelector('.link'))
  7. bind: () => this.link.addEventListener('click', this.shoshowContentwVariableContent, false),
  8. showContent: () => console.log(privateVariable)
  9. }
  10.  
  11. return {
  12. init: () => {
  13. _private.showContent()
  14. _private.cache()
  15. _private.bind()
  16. }
  17. }
  18. })()
  19.  
  20. Application.init() //
  21. console.log(privateVariable) //undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement