Answers for "function ?"

5

function

function factorial(n) {
  if (n == 0) {
    return 1;
  } else {
    return factorial(n - 1) * n;
  }
}
Posted by: Guest on July-11-2021
5

functions

A function is a reusable set of statements to perform a task or calculate a value.
Functions can be passed one or more values and can return a value at the end of their execution. 
In order to use a function, you must define it somewhere in the scope where you wish to call it.
Posted by: Guest on June-23-2020

Browse Popular Code Answers by Language