Skip to content

Instantly share code, notes, and snippets.

@blanklin030
Created September 5, 2019 08:40
Show Gist options
  • Save blanklin030/81816fca2cd259dfcd1b2a38fd49e961 to your computer and use it in GitHub Desktop.
Save blanklin030/81816fca2cd259dfcd1b2a38fd49e961 to your computer and use it in GitHub Desktop.
Object.create的用法
<script type="text/javascript">
const a = {a:1}
console.log(a)
console.log("===================")
const b = Object.create(null,{
	a: {
		writable:true,
		configurable:true,
		value: 2
	}
})
console.log(b)
console.log("===================")
const c = Object.create(Object.prototype,{
	a:{
		writable:true,
		configurable:true,
		value:3
	}
})
console.log(c)
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment