why is "undefined" showing up on top of my text 

```
function myname() {
    document.write('Im john doe ');
}

function myage() {
    myname();
    document.write('Im 47 years old');
}
document.querySelector('.test').innerHTML=myage();

```

[JSBin](https://jsbin.com/cuhovijesa/edit?html,output) here's the full code