in Technology by

Predict the output of the following JavaScript code.

<script type="text/javascript" language="javascript"> 

  

var x=5; 

var y=6; 

var res=eval("x*y"); 

document.write(res); 

  

</script> 

A. “30”

B. 30

C. 5*6

D. “5*6”

1 Answer

0 votes
by

Ans: B
Explanation: eval command will evaluate the operation. Here it is 5*6=30.
\linebreak

Related questions

0 votes
    Predict the output of the following JavaScript code. var a="blogsforblog"; var x=a.lastIndexOf("b"); document.write(x); A) 8 B) 0 C) 9 D) Error...
asked Feb 27, 2021 in Technology by JackTerrance
0 votes
    Predict the output of the following JavaScript code. a = 8 + "8"; document.write(a); A) 16 B) Compilation Error C) 88 D) Run Time Error...
asked Feb 27, 2021 in Technology by JackTerrance
0 votes
0 votes
    1. Predict the output of the following operations if x=5 and y=3. x>=10&& y>=4 f. x>=1 || y>=4 Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    (i) x=5, y=6,2=20 Q8) Consider the following statements and describe the output/statement required: ... multiple assignment statements. Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    Code A: var x = 10; y = --x + 1; alert(y); Code B: var x = 10; y = x-- + 1; alert(y); What is the output for code A and B? 1. 10,11 2. 10,10 3. 11,10 4. 11,11...
asked Feb 23, 2021 in Technology by JackTerrance
+1 vote
    Code A: var x = 10; y = --x + 1; alert(y); Code B: var x = 10; y = x-- + 1; alert(y); What is the output for code A and B? a)10,11 b)10,10 c)11,10 d)11,11...
asked Oct 8, 2020 in Technology by JackTerrance
0 votes
    In Java, what will be the output of the following code and how? double x=2.9,y=2.5; (SOP is abbreviated form ... x),y)); Explain how Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3); 1. 20 2. 60 3. 3 4. Nothing...
asked Feb 25, 2021 in Technology by JackTerrance
0 votes
    What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3); A) 20 B) 60 C) 3 D) Nothing...
asked Oct 9, 2020 in Technology by JackTerrance
0 votes
    Which of the following is useful way to put text, code, data, output all in one document? (a) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    e)What will be the output of the following code? (2) x,y=4,8 z=x/y*y print(z) Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Predict the output. Hi {{name}}. is used with the context variable: var context = { "name" : "< b>Jane Roe< /b>" } (1)Jane Roe ... display (3)< b>Jane Roe< /b> (4)< b>Jane Roe< /b>...
asked Aug 17, 2021 in Technology by JackTerrance
0 votes
    Write the short cut keys to move text in word document. 1. ctrl+A 2.Alt+m 3.ctrl+x ctrl+v 4. Ctrl+p ctrl+Q Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    What is the output for the following function test(x) { while(x < 5) { x++; } return x; } alert(test(2)); A) 6 B) 3 C) 2 D) 5 #insurance and Loans...
asked Oct 9, 2020 in Technology by JackTerrance
...