摘要: 在JavaScript里面,一般我们想让程序在function里面执行到一半时,经过判断或者完成某种操作后停止执行后面的代码,会用return结束掉function。 fuction(){ //do something... if(stopRun == true){ return } //conti 阅读全文
posted @ 2019-11-16 20:37 清风莫拂 阅读(1079) 评论(0) 推荐(0)
摘要: 用for循环取数组的值 第一种 <script> // 用for循环取数组的值 function f1(){ let a = ['A', 'B', 'C', 'D', 'E']; for (let item in a){ // console.log(a[item]); let s = a[item 阅读全文
posted @ 2019-11-16 20:32 清风莫拂 阅读(183) 评论(0) 推荐(0)