系统:Windows 11
软件:WPS表格11
- 本系列介绍一款类Excel的软件,WPS表格
- 当然也是介绍其宏开发,不同的是,使用的JS宏
- 会同样介绍多个系列,本系列介绍一些基础知识
function 顺序结构() {console.log("顺序结构");let a = 1;let b = 2;let c = 3;let d = a+b+c;console.log(d)
}function 判断结构() {console.log("判断结构");let a = 1;let d;if (a>1) {d = a+1} else {d = a-1}console.log(d)
}function 循环结构() {console.log("循环结构");let a = 5;for(var i=0; iconsole.log(i)}}

图1 代码截图

图2 代码截图(带分号)
if (条件){条件为真则执行} else {条件为假则执行}for(初始值; 条件; 循环步长),还有其它循环方式,一般循环会与判断结构结合使用
图3 执行代码

图4 执行结果
learningBin更多精彩,请关注微信公众号
扫描二维码,关注本公众号

上一篇:字符串和编码那些事
下一篇:大学网课搜题公众号系统