DEV Community

Lakshya Tyagi
Lakshya Tyagi

Posted on

4 2

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

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay