维科纳蒂 »
×
改变方向
在 Codepen 上打开
更改主题,深色/浅色
<!DOCTYPE html> <html> <body> <h2>Використання JavaScript Symbol()</h2> <p id="demo"></p> <script> const person = { firstName: "John", lastName: "Doe", age: 50, eyeColor: "blue" }; let id = Symbol('id'); person[id] = 140353; document.getElementById("demo").innerHTML = person[id] + " " + person.id; </script> </body> </html>