ăJavascriptăWhy do these increments and decrements NOT show on the browser?
Hi, I just recently started to study coding and I am a new learner of Javascript. Increments and decrements do not properly show on my browser, and I'd like to know why. Did I make any mistake or are these originally the numbers that cannot be shown by themselves? These did not work; var f = 5 ++; var g = 5 --; var h = ++ 5; var i = -- 5; document.write(f); document.write(g); document.write (h); document.write(i); These worked; var x = 5 - 5; var a = 5 + 5; var b = 5 * 5; var d = 5 / 5; var e = 5 % 5; document.write(a + x + b + "<BR/>"); document.write(d + "<BR/>"); document.write(e + "<BR/>"); document.write(x + "<BR/>"); document.write(a + "<BR/>"); Btw, I checked several times if there are any minor mistakes on forgetting ";" or spaces between numbers and "++" or "--". I'd appreciate it if someone can help me on this. Thank you.