Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

closure

func main() {
  x := 0
  increment := func() int {
    x++
    return x
  }
  fmt.Println(increment())
  fmt.Println(increment())
}
Source by www.golang-book.com #
 
PREVIOUS NEXT
Tagged: #closure
ADD COMMENT
Topic
Name
6+2 =