10
0

21_symbl.html 539 B

1234567891011121314151617181920212223242526
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <script>
  10. let obj = {
  11. a:1,
  12. b:2
  13. }
  14. let sym = Symbol();
  15. // console.log(sym)
  16. obj[sym] = "hello";
  17. // console.log(obj)
  18. // console.log(obj[sym]);
  19. for(let k in obj){
  20. console.log(k)
  21. }
  22. console.log(Object.keys(obj))
  23. </script>
  24. </body>
  25. </html>