js两种创建对象方式

时间:2023-03-09 14:42:24
js两种创建对象方式
js创建方法的两种方式
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body> </body>
<script type="text/javascript">
function show(){
alert("ok")
}
//show(); var shows=new Function("name","age",'alert(name+age)');
shows('tom',12);
</script>
</html>

函数的属性

alert(shows.length)
alert(shows.toString())