bind()

2017-06-16 13:59:00
admin
原创
342
<!DOCTYPE html>
<html>
<head>
    <title>Function Type bind() Method Example</title>
    <script type="text/javascript">
        
        window.color = "red";
        var o = { color: "blue" };
                           
        function sayColor(){
            alert(this.color);
        }
        var objectSayColor = sayColor.bind(o);
        objectSayColor();   //blue


    </script>
</head>
<body>
    <p>This example is known to work in Internet Explorer 9, Firefox 4, and Chrome 6.</p>
</body>
</html>
文章分类
联系我们
电话: 18902328227
Email: 2689701946@qq.com
QQ: 2689701946
微信: 18902328227
地址: 广州番禺区繁华路
  • 在线客服
  • 关注微信
  • 联系电话
    • 欢迎咨询
    • 欢迎加入QQ群 303257430
  • 公众号:源宝网络
    • 联系电话及微信号 18902328227