1.

What Is Eval() And Floor() Functions In Javascript?

Answer»

The eval() function used in execute an argument as expression or we can SAY that evaluate a string as expression and it used to parse the JSON.

The example over eval() function as given below.

VAR x = 14;
eval('x + 10'); //The OUTPUT is 24.
Another over eval() function example
eval('var myEval = 10');
console.log(myEval); // The output is 10.

The floor() function is a static method of Math and we can write as Math.floor() and used to ROUND the number of downwards. i.e.

Math.floor(1.6);//The output is 1.

The eval() function used in execute an argument as expression or we can say that evaluate a string as expression and it used to parse the JSON.

The example over eval() function as given below.

var x = 14;
eval('x + 10'); //The output is 24.
Another over eval() function example
eval('var myEval = 10');
console.log(myEval); // The output is 10.

The floor() function is a static method of Math and we can write as Math.floor() and used to round the number of downwards. i.e.

Math.floor(1.6);//The output is 1.



Discussion

No Comment Found