1<script>
2function showName() {
3 var result;
4 result = addString('Hello', ' World');
5 document.write (result );
6}
7
8// in below we will check how to return string from function
9function addString(fName, lName) {
10 var val;
11 val = fName + lName;
12 return val; // returning string from function
13}
14</script>
15<input type = "button" onclick = "showName()" value = "Result">
16
17/*
18I hope it will help you.
19Namaste
20Stay Home Stay Safe
21*/