javascript function对象

时间:2014-10-04 19:44:37   收藏:0   阅读:139
<html>
    <body>
        <script type="text/javascript">
            Function.prototype.get_my_name = function(){
                return this;
            }; 
            var func = function(){
                this.my_name = ‘function name‘;
            }

            console.log(func.get_my_name());
            console.log(func.my_name);//想明白为什么不能够输出my_name
        </script>
    </body>
</html>

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!