javascript function对象

<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>

 

posted @ 2014-10-04 18:37  wuhn  阅读(158)  评论(0编辑  收藏  举报