Why is the word "undefined" appearing on top of my text?
function printName() {
document.write('My name is John Doe.');
}
function printAge() {
printName();
document.write('I am 47 years old.');
}
document.querySelector('.test').innerHTML = printAge();