Answers for "how to retrun value in a function in javascript"

0

how to retrun value in a function in javascript

<html>
   <head>
      <script>
         function concatenate(name, age) {
            var val;
            val = name + age;
            return val;
         }
         function DisplayFunction() {
            var result;
            result = concatenate('John ', 20) ;
            document.write (result );
         }
      </script>
   </head>
   <body>
      <p>Click the following button to call the function</p>

      <form>
         <input type = "button" onclick = "DisplayFunction()" value = "Result">
      </form>
   </body>
</html>
Posted by: Guest on March-17-2021

Code answers related to "how to retrun value in a function in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language