DEV Community

Cover image for "Do you know what '++' does?"
commdao
commdao

Posted on

"Do you know what '++' does?"

Finished another JavaScript tutorial and shared the project with a friend. He was reviewing one of the functions and asked, "Do you know what ++ does?"

timerTime++;
Enter fullscreen mode Exit fullscreen mode

Gut reaction was stress! But my friend wasn't gatekeeping. He wasn't saying "Do you even know what ++ does?"-- he was just legitimately checking in. That's why he's my dawg.

In the context of this project, "timerTime++;" ended up meaning the same thing as

timerTime = timerTime + 1;
Enter fullscreen mode Exit fullscreen mode

But, top dawg reminded me that ++ can have different outcomes in different uses. And that's... fun.

I know I definitely looked up the difference between i++ and ++i before.

Something, something loops.

It's definitely not fully ingrained yet. But look at that:

  • usage
  • reflection
  • research

I utilized it without fully understanding. I reviewed how well I got the concept, and when I realized it wasn't quite all there... I was able to look it (back) up (again).


Note: we call him top dawg cuz he's a top dawg.

Top comments (0)