Q. Consider the following code snippet :
var grand_Total=eval("10*10+5");
The output for the above statement would be :

  • (A) 10*10+5
  • (B) 105 as a string
  • (C) 105 as an integer value
  • (D) Exception is thrown
πŸ’¬ Discuss
βœ… Correct Answer: (C) 105 as an integer value
Explanation: Even if the string value passed as a parameter to eval does represent a numeric value the use of eval() results in an error being generated.
Explanation by: Mr. Dubey
Even if the string value passed as a parameter to eval does represent a numeric value the use of eval() results in an error being generated.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
179
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
82%
Success Rate