DEV Community

Lakshya Tyagi
Lakshya Tyagi

Posted on

What will the code below output to the console and why?

Write your answer in comment

  1. console.log(1 + +"3" + "3");
  2. console.log(1 +"3" + "3");
  3. console.log(1 + -"1" + "3");
  4. console.log(+"1" + "1" + "3");
  5. console.log("X" - "Y" + "3");
  6. console.log("X" - "Y" + 3);

Top comments (4)

Collapse
 
lakshyatyagi24 profile image
Lakshya Tyagi

javaScript

Collapse
 
metalmikester profile image
Michel Renaud

There's a Python tag in the question (at first I thought it was JavaScript).

Collapse
 
lakshyatyagi24 profile image
Lakshya Tyagi

yeh sorry by mistake i put wrong tag

 
metalmikester profile image
Michel Renaud

I've been meaning to learn Python for years but... Ooooh! Netflix! LOL