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.
var greeting = new Function("name", "return 'Hello ' + name"); // Noncompliant
var greeting = function (name) {
return 'Hello ' + name;
}
or
function greeting (name) {
return 'Hello ' + name;
}