Function() कंस्ट्रक्टर किसी भी संख्या में स्ट्रिंग आर्गुमेंट्स की अपेक्षा करता है। अंतिम आर्गुमेंट फंक्शन का बॉडी होता है - इसमें मनमाने जावास्क्रिप्ट स्टेटमेंट्स हो सकते हैं, जो सेमीकॉलन से अलग होते हैं।
उदाहरण
निम्नलिखित कोड को चलाकर new Function Constructor के साथ फंक्शन को इनवोक करना सीखें:
<html> <head> <script> var func = new Function("x", "y", "return x*y;"); function multiplyFunction(){ var result; result = func(15,35); document.write ( result ); } </script> </head> <body> <p>Click the following button to call the function</p> <form> <input type = "button" onclick = "multiplyFunction()" value = "Call Function"> </form> </body> </html>