 悬赏园豆:10
                [待解决问题]
                悬赏园豆:10
                [待解决问题] 
            
                 
        <script>
function sum(name, age, sex) {
    }
    function sun(x) {
        sum(x.name, x.age, x.sex)
    }
    var a = "liwei"
    var b = 18;
    var c = "男"
    console.log(sun({name: a, age: b, sex: c}));
</script>
//我想知道的是下面为什么不能输出liwei 18 男
以为sun和sum都无返回值,console.log就是undefined
<script>
    function test(word){
	
    }
	
   function test2(word){
	return word;
   }
	
   console.log(test('11'));
   console.log(test2('22'));
</script>
上面代码,输出结果:
undefined
22
大神您好,我该怎么才能实现输出 liwei 18 男呢?
@把那只小熊还给我: 在sun方法内部添加:console.log(x); 外面就不需要console.log了
function sun(x) {
        console.log(x);
        sum(x.name, x.age, x.sex);
    }
或者在sum里添加:
console.log("name:"+name+",age:"+age+",sex:"+sex);
@E行者: 大神您好,方便加您微信吗?我自己在学习过程中,有很多不懂的地方,好希望有个人能指导
