×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

JavaScript & DHTML example - How to assign a function to a variable with the JavaScript Function contructor?


JavaScript & DHTML - How to assign a function to a variable with the JavaScript Function contructor?

var add= new Function("x", "y", "return x + y");
 
It's absolutely similar to the following function declaration:
 
function add(x,y)
 
{  
   return x+y;

}

Category: JavaScript & DHTML

 
<< Go back