您的位置:首页 > 其它

函数里写函数;函数是对象,也可以给他添加方法

2016-08-12 17:28 218 查看
<!DOCTYPE html>

<html>

<head>

     <meta charset="utf-8">
<title>函数</title>

</head>

<body>

<script type="text/javascript">
window.onload=wrap;
function wrap(){
function tan(){
alert("我被弹出了");
}
tan();
}

    //函数也是对象
function aa(){}
aa.log=function(expression){
console.log(expression);
}
aa.log("函数也是对象,原来还可以这样写啊");

</script>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐