codedamn

Increment Decrement

Created by Codedamn about a year ago

0

No description provided

13 Comments

    1

    Easiesr way to think about this n++ : return n and then increment

    ++n : increment n and then return n

    @bhbmaster

    Kostia Khlebopros

    @bhbmaster

    2

    let num1 = 10; console.log(num1++); // Output -> 10 -> It is known as Post Increment Operator which first prints out the value then increment/ decrement it. console.log(num1); // Output -> 11 console.log(--num1); // Output -> 10 -> It is known as Pre Decrement Operator which first increment/decrement the value then prints it. console.log(num1); // Output -> 10

    Hope so this examples help us out...

    @afzalkhn17

    Afzal Khan

    @afzalkhn17

    1

    Wow the people in the comments are really confusing me

    @fusiion

    Hayden

    @fusiion

    0

    just follow what mehul is teaching. it is simple to understand

    @chineduwali77

    Chinedu Wali

    @chineduwali77

    -1

    22++=22. ++22=23

    @elg83

    Gino Perez

    @elg83

    0

    good

    0

    i will suggest you to add more Practise labs, by the way enjoying the course.

    @coderpatel

    Mithlesh Kumar

    @coderpatel

    0

    ⭐️⭐️⭐️⭐️⭐️

    0

    The course is cool, just need more practice labs

    @ibrahmounk

    Ibrahima MOUNKORO

    @ibrahmounk

    3

    Also if u want to increase or decrease by more than 2 u can use this myAge += 10 //or whatever number u want and the same goes for decreasing myage -= 10

    @lockmancoal

    MR Lokman

    @lockmancoal

    0

    ❤️

    0

    5.15k views till 15-12-22

    0

    You are doing greate work mehul

    @sharun266

    Sharun

    @sharun266

Your comment