Assignment operator

Hey guys, I’m feeling like a dumb dumb right now, and I even googled assignment operators, but I can’t figure the following out, I even wrote it out the long way on a paper for example the one I know is right.

num *=2; // 12

I even wrote it out on a paper num x 2 = 12
The other questions I can’t figure out where they go to even have that output.

Thanks in advance, going to bed now it’s 4:30am and I think it’s time to rest my brain.

@cksmooth Which course was this in? Could you please send me the link to the quiz?

Well actually these are not 4 separate questions. These are 5 lines of code in the same file. Meaning num changes with every line of code ;).

2 Likes

https://www.codecademy.com/practice/tracks/introduction-to-javascript/modules/learn-javascript-introduction/lessons/variables

The questions are random so might take you a while to come across that.

OMG :rofl: :rofl: :rofl: thanks, thought they were 4 separate questions but got it as soon as you told me they were 5 lines of code.

1 Like