Back to feed
Renewal·서른의 생활코딩

Sample source 3) JavaScript basic document structure (user-defined function _ parameters)

NS
normalstory
cover image

If, through user-defined functions, we learned how to walk on our own rather than ride a stroller that the program gives and pulls along,
this time it's our turn to learn how to run.

Parameter... 매개변수 (parameter)... what a tough word...
Hmm.. I was kind of a lit major back in high school though... lol

For instance, if a user-defined function
is defining a useful function separately for various cases,
parameters
play the role of giving the programmer or user the opportunity to define or choose values depending on the situation.
Those chosen variables yield different result values, 
showing more diverse outputs and enabling more efficient communication between program and user.





<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">




<head>


<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />


<title> User-defined function 5. (parameter) </title>




<script type="text/javascript">


//<!CDATA[


//parameter / values placed in the parentheses so the function can receive them


function call(str1,str2){ //function definition


document.write(str1);


alert(str2);


}


//]]]]]]>


</script>




</head>




<body>


<script type="text/javascript"> call ("hello","javascript"); </script>


</body>




</html>


This English version was translated by Claude.

친절한 찰쓰씨
Written by
친절한 찰쓰씨

Pleasant Charles — UI/UX researcher at AIT. Keeping notes on design, planning, and slow days here since 2010.

More on the author's page

Keep reading

Renewal

Why You Should Use .html Instead of .md Seeing Is Believing

Jul 25, 2026·1 min
Renewal

The Most Important Thing About AX

Jul 17, 2026·2 min
Renewal

디지털 기술과 혁신에 대한 논고(지탱하는 힘)

Jul 17, 2026·5 min