user36982
0
Q:

eval javascipt


  var x = 10;
var y = 20;
var a = eval("x * y") + "<br>";
var b =  eval("2 + 2") + "<br>";
var c = eval("x + 17") + "<br>";

var res =  a + b + c;

 
2
//eval() is a global function in JavaScript that evaluates a specified string as JavaScript 
//code and executes it.
eval("alert('this is executed by eval()')");
					//OR
var x = 10;
var y = 20;
var a = eval("x * y") + "<br>";
var res =  a;
2
eval() -> is able to evalute the things inside it , like eval(a+b+c) , wher a=3,b=4,c=4 , so eval(a+b+c) = 11
1

Tags

New to Communities?

Join the community