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
Object.assign()
Object.assign(target, ...sources)
const target = { a: 1, b: 2 }; const source = {}; Object.defineProperty(source, 'nonEnumerable', { value: 42, enumerable: false }); Object.defineProperty(source, 'enumerable', { value: 42, enumerable: true }); const returnedObject = Object.assign(target, source); console.log(returnedObject); // > Object { a: 1, b: 2, enumerable: 42 } console.log(target); // > Object { a: 1, b: 2, enumerable: 42 } console.log(target === returnedObject) // true
nonEnumerable
const target = { key: 'target value' }; const source = { key: 'source value' }; const returnedObject = Object.assign(target, source); console.log(returnedObject); // > Object { key: "source value" }
IE 언제 망해?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Object.assign()
예제 1 : enumerable한 값만 복사
nonEnumerable
속성값은 target으로 할당되지 않은 것을 알 수 있다.예제 2 : 키 충돌시, source 객체의 속성이 더 높은 우선순위
브라우저 호환성
IE 언제 망해?
The text was updated successfully, but these errors were encountered: