// return과 console.log의 차이
function printSquare(x){
console.log(x * y);
}
function getSquare(x){
return x * y;
}
// case 1
printSquare(3); // 9가 console에 출력
// case 2
getSquare(3); // 리턴문이 실행되고, getSquare 함수 종료 -> console에는 아무것도 출력되지 않음
// case 3
console.log(getSquare(3)); // 9가 console에 출력
// case 4
console.log(printSquare(3)); // 9와 undifined 출력
// 9는 printSquare의 실행부분, console.log(x * x)
// undefined는 console.log(printSquare(3))의 리턴값을 출력한 결과
// printSquare 함수에는 리턴문이 작성되어 있지않음 -> undefined 출력!
// * 함수를 선언할 때, 리턴문을 작성하지 않으면 undefined를 리턴함 *