问答详情
源自:4-6 [JavaScript]对象标签、对象序列化

执行完问什么不是输出属性标签,而是[object.object]

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    var person={};
    Object.defineProperties(person,{
        one:{value:30,},
        two:{value:303,enumerable:true,configurable:true}
    });
    var s=Object.getOwnPropertyDescriptor(person,'two');
    document.write(s);

</script>
</body>
</html>


提问者:慕粉1027459051 2019-06-30 10:32

个回答

  • 队友杀手
    2020-09-08 22:11:45

    试试这样 

    document.write(s);

     改为:

    document.write(JSON.stringify(s));


  • qq_慕慕947699
    2019-10-28 10:19:42

    直接控制台打印,console.log(s)

    http://img1.mukewang.com/5db6503b0001a3d506590025.jpg

  • jfhdibrbfjd
    2019-06-30 16:14:02

    看看person对象 写的有没有问题?