JavaScript uses the function keyword followed by the function name, parentheses for parameters, and curly braces {} for the function body. Refer to Control Flow for loops and conditionals and Logical Operators for logic stuff.

function functionName(parameter1, parameter2, ...) {
  // Function body (code to be executed)
  return output; // Optional: return a value
}

Unlike Python, JS does not allow default parameter values within the function declaration. You can achieve similar behavior by assigning default values inside the function body or using techniques like destructuring.