Advertisement
shopnilSS

Increment Decrement Js practice Problem

May 28th, 2021 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Practice one
  2. var a = 5
  3. a--
  4. a = a++ - --a
  5. var b = a-- + a
  6. b ++
  7. --b
  8. var c = b ** 2
  9. c--
  10. --c
  11. ++c
  12. ++b
  13. console.log(a);
  14. console.log(b);
  15. console.log(c);
  16.  
  17.  
  18. //Practice two
  19. var a = 5
  20. a = a++
  21. var b = a++
  22. console.log(a);
  23. var c = b++
  24. console.log(b);
  25. console.log(c);
  26.  
  27.  
  28. //Practice Three
  29. var a = 5
  30. a = a++
  31. var b = a++
  32. var c = b++
  33. var d = b
  34. console.log(a);
  35. console.log(b);
  36. console.log(c);
  37. console.log(d);
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement