Skip to content
New issue

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

JS 属性读写题 #24

Open
CyanSalt opened this issue Dec 25, 2019 · 1 comment
Open

JS 属性读写题 #24

CyanSalt opened this issue Dec 25, 2019 · 1 comment

Comments

@CyanSalt
Copy link
Owner

CyanSalt commented Dec 25, 2019


path: js-property-question


function getObject() {}
function getKey() {}

let obj = getObject();
let key = getKey();

let valueA = obj[key];
let valueB = 3;
obj[key] = valueB
let valueC = obj[key];

assert(isNaN(valueA)); // false
assert(isNaN(valueC)); // false
assert(valueA === valueB); // false
assert(valueB === valueC); // false
assert(valueA === valueC); // false
@CyanSalt
Copy link
Owner Author

function getObject() {
  return localStorage;
}
function getKey() {
  return 'length';
}

@CyanSalt CyanSalt transferred this issue from another repository Feb 24, 2022
@CyanSalt CyanSalt changed the title JS属性读写题 JS 属性读写题 Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant