一、属性1.length——字符串的长度(不区分中英文)var a="chen陈";alert(a.length); //结果:52.constructor——对象的构造函数二、方法A.获取类型1.charAt()——返回在指定位置的字符var a="chen陈";alert(a.charAt...
分类:
编程语言 时间:
2015-11-25 21:45:00
阅读次数:
142
JS1.对于原型而言,只要构造函数才有prototype属性,而构造函数的实例是没有该属性的,也就是说console.log(a1.prototype)输出的是undefined.2.每一个函数的prototype属性指向的对象都包含唯一一个不可枚举属性constructor,constructor...
分类:
其他好文 时间:
2015-11-18 00:51:18
阅读次数:
188
JS1.对于原型而言,只要构造函数才有prototype属性,而构造函数的实例是没有该属性的,也就是说console.log(a1.prototype)输出的是undefined.2.每一个函数的prototype属性指向的对象都包含唯一一个不可枚举属性constructor,constructor...
分类:
其他好文 时间:
2015-11-17 18:47:26
阅读次数:
191
简述prototype:在js中,每个构造函数都有一个原型属性prototype,因为这个属性的值通常是一个对象,又叫原型对象!你不需要显式的去定义原型对象,因为每个构造函数都会一个原型属性,通常在这个原型对象中,会包含一个constructor属性指向该原型对象的构造函数:functiona(){...
分类:
编程语言 时间:
2015-11-13 18:44:32
阅读次数:
224
C++11新特性继续。
Static assertion
static_assert 是在编译时期的断言,作用不言而喻的。
语法是这样:static_assert ( bool_constexpr , string ) 其中:
bool_constexpr: 常量表达式
string: 如果bool_constexpr表达式为false, 这个string就是编译时候报的错误。看...
分类:
编程语言 时间:
2015-11-12 11:55:49
阅读次数:
226
构造函数(constructor)是一种特殊的方法 。主要用来在创建对象时初始化对象, 即为对象成员变量赋初始值,总与new运算符一起使用在创建对象的语句中 。特别的一个类可以有多个构造函数 ,可根据其参数个数的不同或参数类型的不同来区分它们 即构造函数的重载。构造函数的功能主要用于在类的对...
分类:
其他好文 时间:
2015-11-08 17:41:49
阅读次数:
129
14.1 In terms of inheritance, what is the effect of keeping a constructor private?这道题问我们用继承特性时,如果建立一个私有的构建函数会怎样。只有能访问该函数的私有变量或函数的东西才能访问私有构建函数,比如内部类就可以...
分类:
其他好文 时间:
2015-11-06 14:46:28
阅读次数:
153
(一)为什么子类的构造方法在运行之前,必须调用父类的构造方法?能不能反过来?为什么不能反过来?答案:java 自动在派生类构造器中插入基类构造器运行,例如class A { A() { System.out.println("A constructor"); } } cla...
分类:
其他好文 时间:
2015-11-06 14:33:27
阅读次数:
156
Define a filed should has validation:export class DemoFormSku { myForm: ControlGroup; sku: AbstractControl; constructor(fb:FormBuilder) { ...
分类:
其他好文 时间:
2015-11-06 07:08:11
阅读次数:
214
Reference: TutorialPoints, GeekforGeeksThecopy constructoris a constructor which creates an object by initializing it with an object of the same class...
分类:
编程语言 时间:
2015-11-06 06:47:48
阅读次数:
174