In addition to being obtuse from a syntax perspective, function constructors are also dangerous: their execution evaluates the constructor's string arguments similar to the way eval works, which could expose your program to random, unintended code.

Instead, simply declare the function as usual.

Noncompliant Code Example

var greeting = new Function("name", "return 'Hello ' + name");  // Noncompliant

Compliant Solution

var greeting = function (name) {
  return 'Hello ' + name;
}

or

function greeting (name) {
  return 'Hello ' + name;
}