55. What is a first order function? Explain with the help of an example in JavaScript.
easy
A first-order function is a function that does not accept other functions as arguments and does not return functions as its output. In other words, it is a function that operates only on data, without any knowledge of how the data was created or manipulated by other functions.

In JavaScript, we can define a first-order function using the `function` keyword to ensure that it meets the criteria of not accepting or returning functions as arguments or output.
function sum(a, b) {
  return a + b;
}

const result = sum(2, 3);
console.log(result); // Output: 5
In this example, the `sum` function takes two arguments `a` and `b` and returns their sum value. Since the output of the function is a simple value that does not depend on any other functions or manipulations, it can be considered a first-order function.

It's worth noting that functions that accept or return functions as arguments or output are not first-order functions, since they rely on the ability to operate on higher-order functions. Higher-order functions are functions that take other functions as arguments or return functions as their output.