Open ankit-ml12 opened 11 months ago
.js
let a = 1;
let b = 1;
console.log(a+b);
/execute.js
In this example,a
andb
are variables that are set to1
and2
on theconsole.log
function. The+
operator adds thea
andb
values and prints the result to theconsole.log
function.
This example uses thelet
statement to create a variable,a
, and assign it to thea
variable. Thelet
statement creates a variable,b
, and assigns it to theb
variable.let
statements can also be defined using multiple statements.
In the above example,a
andb
are variables that are set to1
and2
on theconsole.log
function. The+
operator adds thea
andb
values and prints the result to theconsole.log
function.
1+1=? /execute
SELECT 1+1
FROM table_name WHERE 1
= "1"
/execute what is the output of the following code let a=2 let b=1 console.log(a+b)
a=2 b=1 console.log(a+b)
final outcome: 3
/execute what is the output of this code let a=7 let b=8 console.log(a+b)
console.log(a+b);
output: 11
let a=7
let b=8
console.log(a+b)
let a=7 let b=8 console.log(a+b);
output: 11
/execute what is the output of this code let a=1 let b=2 console.log(a+b)
Output:
1 + 2
3
/execute what is the output of this code let a=1 let b=2 console.log(a+b)
a = 1
b = 2
console.log(a + b)
1
The+
operator is arithmetic operator that adds the two operands. When the operands do not have the same type, it converts the second operand to the type of the first operand. Theconsole.log
statement prints the value of thea+b
operation to the console.
In this example, thea
andb
variables have the same type,number
. Therefore, the+
operator adds the two numbers and prints the result to the console.
/execute what is the output of this code let a=1 let b=2 console.log(a+b)
It outputs: 3
let a=1 let b=1 console.log(a+b) /execute