gpt4 book ai didi

javascript - 为什么给变量赋值给自己内存=内存?

转载 作者:行者123 更新时间:2023-12-03 03:47:23 29 4
gpt4 key购买 nike

我目前正在分析一些 javascript shell 代码。这是该脚本中的一行:

function having()
{
memory = memory;
setTimeout("F0VTp03Y()", 2000);
}

我不太明白内存=内存,给变量赋值给自己有什么意义。我将不胜感激的帮助!

最佳答案

我能想到将变量分配给自身的唯一原因是变量 shadowing .

Variable shadowing occurs when a variable declared within a certain scope (decision block, method, or inner class) has the same name as a variable declared in an outer scope. At the level of identifiers (names, rather than variables), this is known as name masking. This outer variable is said to be shadowed by the inner variable, while the inner identifier is said to mask the outer identifier. This can lead to confusion, as it may be unclear which variable subsequent uses of the shadowed variable name refer to, which depends on the name resolution rules of the language.

但就您而言,内存变量不是函数的参数,因此它没有任何意义。

关于javascript - 为什么给变量赋值给自己内存=内存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45323907/

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