0% found this document useful (0 votes)
9 views2 pages

JavaScript Console Output Explained

Uploaded by

arora.tanmoy23
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

JavaScript Console Output Explained

Uploaded by

arora.tanmoy23
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Resources

JavaScript – Arithmetic Operators


Practice Problems

Answer the following questions WITHOUT executing the code in Codepen.


Also, explain why do you think your answer is correct.

Q1. What will be printed in the console?

var num1 = 1 + 5;
var num2 = num1 / 4;
var num3 = 1 + 5;
var num4 = num3 / 4;
[Link](num2 + " " + num4);

Q2. What will be printed in the console?

var a = 1;
var b = 2;
var c;
var d;
c = ++b;
d = a++;
c++;
b++;
++a;
[Link](a + " " + b + " " + c);

EdYoda Digital University [Link]


Page | 1
Q3. What will be printed in the console?

var input = 7;
var output1 = ++input + ++input + ++input;
var output2 = input++ + input++ + input++;
var output3 = input++ + ++input + input++;
[Link](output1 + ' ' + output2 + ' ' + output3);

Codepen URL: [Link]

My Twitter Handle: @qaifikhan

All the Best!

EdYoda Digital University [Link]

Page | 2

You might also like