Skip to content

Instantly share code, notes, and snippets.

@mrchoke
Last active April 3, 2019 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchoke/20e36538bf82918fb7ff2cb24c6de546 to your computer and use it in GitHub Desktop.
Save mrchoke/20e36538bf82918fb7ff2cb24c6de546 to your computer and use it in GitHub Desktop.
เผลอประกาศเป็น const แล้วไปแก้ค่า ได้เฉย
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test JS</title>
</head>
<body>
<h1>เบิ่งหน้าคอนโซลโลด!!!</h1>
<script>
let datas = {a: 'haha',b:'cat'}
const clone = datas
console.log(datas)
console.log(clone)
delete clone.a
console.log(datas)
console.log(clone)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment