hey everyone welcome back in this video i will quickly discuss something known as increment and decrement operators right now these are just fancy way of doing something which we have just done in the last video so first of all let me just clear this out and let me just go ahead and say my h again as NUMBER_TOKEN. now we saw that if i just make this lit i can do my age is my h plus one and if i console log this you will see that my h in fact comes out to be NUMBER_TOKEN. now there is another fancy way of doing the same line which line number two does and that is by writing my h plus plus that's it no late no reassignment nothing like that remember i told you that hey my h plus one would not work because we are not storing this value anywhere right you can see my h plus NUMBER_TOKEN still gives me NUMBER_TOKEN but my h plus plus gives me NUMBER_TOKEN right so this is because these two pluses are special these two pluses actually evaluate to the same statement which we wrote my age is my h plus one so you might ask why do we need that well we technically don't i mean we would still be able to write code if that did not exist in fact a lot of languages also does not include the support of doing plus plus um like this but i mean just another feature right just like your phone has tons of feature a programming language also has tons of functionalities does not necessarily mean you have to use them always but it's good to know that it exists anyway there's another operator called minus minus which exists which is you know NUMBER_TOKEN goes to NUMBER_TOKEN. you might think there might be a star star operator but it would not make i mean i don't know like it could make a lot of sense if you just want to square the number real quick but no that does not work these increment and decrement operators only exist with addition and subtraction because these are the most common things which people usually do especially in loops which we will see when you want to loop over a certain statement you want to maintain a counter which just keeps on incrementing by one one one one until it hits a certain condition so there is where we use these conditions a lot but you should anyway know about this plus plus adds one minus minus removes one and the fun fact about this is that you can add these plus plus after the variable or before the variable and there is a slight difference in these two ways which we will discuss maybe later down the line but nothing you should worry about at this stage right you can add this before the variable you can add this after the variable but of course you cannot add this before and after this would not work right this is like a weird syntax so if you want to increment it by two either do it twice or just write a single statement which just says my age is plus my age is my h plus two right so that is how you would work with it and that is how increment and decrement operators also work
NO_SEGMENT_TOKEN