Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Singleton = (->
- instance = null
- someVal = 5
- init = ->
- run: ->
- console.log "running ..."
- getVal: ->
- someVal
- setVal: (newVal) ->
- someVal = newVal
- fromZeroToVal: ->
- i=0
- while i<someVal
- console.log "i => " + i
- i++
- return
- getInstance: ->
- instance = init() if instance is null
- instance
- )()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement