日期:2014-05-16 浏览次数:20608 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">两者的区别是?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type='text/javascript'>
var Persons = function() {
return function() {};
};
var persons = new Persons;
var persones = Persons();
//var _persons = new persons;
//alert(person.__proto__.constructor);
//alert(persons.__proto__.constructor);
//alert(_persons.__proto__.constructor);
//alert(persones.__proto__.constructor);
//alert(Person.__proto__.constructor);
alert(persons instanceof Function);
alert(persones instanceof Function);
</script>
</head>
<body>
</body>
</html>
var func = function() {};
var Persons = function() {
return func;
};
var persons = new Persons;
var persones = Persons();
alert(persons === persones);