What is function() constructor in JavaScript?

JavascriptWeb DevelopmentFront End Technology

The function() constructor is used in JavaScript to create a new function object. The objects created are parsed when the function is created.


You can try to run the following code to learn how to work with function() constructor

Live Demo

         var num = new Function('p', 'q', 'r', 'return p * q * r');
         document.write("Value after multiplication: "+num(5, 2, 9));
Updated on 07-Jan-2020 08:49:44