gpt4 book ai didi

javascript将对象传递给函数

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:16:35 25 4
gpt4 key购买 nike

<分区>

var o = {};
(function(x){x=null})(o); //o is NOT null after this statement
(function(x){x.foo = "foo"; x.bar = "bar";})(o) //o has properties foo and bar after this statement

将对象 o 传递给函数时发生了什么?第一个函数使它看起来没有通过;第二个函数使 o 看起来通过了

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com