Javascript return with colon

前端 未结 3 1012
谎友^
谎友^ 2020-12-13 02:01

I am learning JavaScript and have come across of the structure below:

var Test = (function () {

  function func1() {
      //do something.....
  }

  functi         


        
3条回答
  •  有刺的猬
    2020-12-13 02:28

    That works like a class in other programming languages. Therefore, you can access the public func1 member using Test.func1 and call it like a normal function using Test.func1().

提交回复
热议问题