Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What's the value of sum? const sum = eval('10*10+5'); A: 105 B: "105" C: TypeError D: "10*10+5"
Home
JavaScript
What's the value of sum? const sum = eval('10*10+5'); A: 105 B: "105" C: TypeError D: "10*10+5"
0
votes
asked
Feb 26
in
JavaScript
by
DavidAnderson
What's the value of
sum
?
const
sum
=
eval
(
'10*10+5'
)
;
A:
105
B:
"105"
C:
TypeError
D:
"10*10+5"
javascript-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Feb 26
by
DavidAnderson
Answer: A
eval evaluates codes that's passed as a string. If it's an expression, like in this case, it evaluates the expression. The expression is 10 * 10 + 5. This returns the number 105.
...