Created
September 22, 2016 06:53
-
-
Save cyio/d46d05ee565ce8c3a95c57310b9ccf6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS不能实现成员不可变数组 | |
const a = 1 | |
const arr = [a] | |
console.log(arr) | |
arr[0] = 2 // 赋值时替换了常量a | |
console.log(arr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment