Difference Between Function and Function

Function is a constructor that creates an object

function is a keyword that declares a function object


It can be judged by the following examples:

    function f(){};

    var a = function(){};

    var a = new Function();

However, it is not recommended to declare a function object by means of Function, because when adding properties to this object (writing its methods), the code will be parsed again:

    var test = new Function ();

    function test (){};

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325919845&siteId=291194637