filmov
tv
JavaScript - Arithmetic Operators

Показать описание
Hey guys, in this video we will learn about Arithmetic Operators in JavaScript.
Practice Problems:
================
Try to answer the following questions without executing the code in codepen. Post your answers in the comment section below. Also, explain why do you think your answer is correct. Best of Luck!!
Q.
What will be printed in the console?
var num1 = 1 + 5;
var num2 = num1 / 4;
var num3 = 1 + 5;
var num4 = num3 / 4;
Q.
What will be printed in the console?
var a = 1;
var b = 2;
var c;
var d;
c = ++b;
d = a++;
c++;
b++;
++a;
Q.
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++;
My Twitter Handle: @qaifikhan