-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdatatype.html
38 lines (26 loc) · 978 Bytes
/
datatype.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<head>
</head>
<body>
<script>
//value type Undefined, Null, Boolean, Number, String
var v1 = undefined;
var v2 = null;
var v3 = true;
var v4 = 10;
var v5 = "abc";
//refrence type
var obj = new Object();
obj.name = "Teafish";
console.log(obj.contructor); //function Object() { [native code] }
console.log(obj.hasOwnProperty("name")); //true
console.log(obj.isPrototypeOf(Object)); //false
function Person(){
this.name;
this.age;
}
var zhangsan = new Person();
console.log(zhangsan.isPrototypeOf(Person));
</script>
</body>
</html>