리턴값이 있는 함수
return문은 함수에서 결괏값을 반환할 때 사용합니다.
리턴값이 있는 함수
function func4(){
let str = "함수가 실행되었습니다.";
return str;
}
let value = func4();
document.write(value);function func6(){
document.write("함수가 출력되었습니다.6");
return;
document.write("함수가 출력되었습니다.7");
}
func6();
//함수가 출력되었습니다.6function func5(num1,num2){
return num1 + num2;
}
let result = func5(100,200);
document.write(result);
//300이미지 슬라이드
Last updated