摘要:
var的特点 函数作用域 let的特点 没有变量提升,必须先声明。再调用 同一个作用域下不可以重复定义同一个名称 块级作用域 function fun(){ let a = 10 if(true){ let a =100 } console.log(a) }输出a为10,因为let为块级作用域。 暂 阅读全文
摘要:
function f1() { console.log("hello"); f1(); }; f1();//浏览器崩溃,因为没有结束条件——死循环 改进如下: var i=0; function f1() { i++; if (i<5){ f1(); } console.log("i"); }; f 阅读全文
摘要:
生成随机验证码 包括字母数字 import random def make_code(n): res="" for i in range(n): s1=str(random.randint(1,9)) s2=chr(random.randint(65,90)) res+=random.choice( 阅读全文