<script>var a={}a.name='hahaha';a.age=20;a.say=function(){"hello"};document.write(a.say())</script>/*为啥访问对象 say的时候 浏览器输出的是 undefined呀,是不能直接输出函数值?*/
Guanhui2020-05-04 10:44:02
因为你say()方法里没return
正解. //say=function(){"hello"}; say=function(){return "hello"};