javascript怎么实现两变量相加
在javascript中,可以使用“+
”或“+=
”运算符实现加法运算。
示例:
var x = 10, y = 5, a; a=x + y; x+=y; console.log(a); console.log(x); a=x + y; console.log(a);
【相关推荐:javascript学习教程】
在javascript中,可以使用“+
”或“+=
”运算符实现加法运算。
示例:
var x = 10, y = 5, a; a=x + y; x+=y; console.log(a); console.log(x); a=x + y; console.log(a);
【相关推荐:javascript学习教程】
作者:知识百科网本文地址:/qianduan/js/34204.html发布于
2023-08-29 18:53:04
文章转载或复制请以超链接形式并注明出处