文章详情页
创建对象的问题
浏览:125日期:2024-05-31 10:36:04
问题描述
<script>var a={}a.name='hahaha';a.age=20;a.say=function(){"hello"};document.write(a.say())</script>/*为啥访问对象 say的时候 浏览器输出的是 undefined呀,是不能直接输出函数值?*/
问题解答
回答1:因为你say()方法里没return
相关文章:
排行榜

网公网安备