a+=5 ,同a = a+5
a-=5 ,同a = a-5
a*=5 ,同a = a*5
a/=5 ,同a = a/5
範例:
var a =10;
document.write("a+=5為:"+(a+=5));
document.write("<br>" );
document.write("a-=5為:"+(a-=5));
document.write("<br>" );
document.write("a*=5為:"+(a*=5));
document.write("<br>" );
document.write("a/=5為:"+(a/=5));
document.write("<br>" );
結果:
其它文章
沒有留言:
張貼留言