加载中...

@class


描述:此函数旨在需要使用"new"关键字调用,即构造函数。

别名:@constructor

Syntax(语法)

@class [<type> <name>]

Overview(概述)

@class标签标明函数是一个构造器函数,意味着需要使用 new 关键字来返回一个实例,即使用 new 关键字实例化。

Examples(例子)

例如,一个函数构建一个Person实例:

  1. /**
  2. * Creates a new Person.
  3. * @class
  4. */
  5. function Person() {
  6. }
  7.  
  8. var p = new Person();

还没有评论.