0
Shorthand Assignment Operators
Somebody please explain a bit more about Shorthand Assignment Operators
2 Réponses
+ 3
short hand operator make things more easier.
for ex.
if you write.....
a = a+5
then this can be written using short hand operator as.....
a += 5
+ 2
x = x + 1;
is the same as
x += 1;
they both add 1 to the variable x except the second one is the a little faster to write. You don't have to use the shorthand style but just be aware of it so you don't get confused when you find it in someone else's code.