We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var a = [1, 2, 3] var b = [1, 2, 3, 4] a = b a.reverse() console.log(b)
The text was updated successfully, but these errors were encountered:
[4, 3, 2, 1]
Sorry, something went wrong.
有两个数组对象[1, 2, 3],[1, 2, 3, 4], a = b, 将变量a指向[1, 2, 3, 4], b也指向这一个数组, a.reverse()操作堆内存中的数组,输出b的时候变化也会显现出来。 [1, 2, 3]如果没有其他引用的话,垃圾回收会清掉它。
No branches or pull requests
The text was updated successfully, but these errors were encountered: