2018年9月26日

摘要: get 与 post 的区别 了解和使用 get和post是HTTP与服务器交互的方式, 说到方式,其实总共有四种:put,delete,post,get。 他们的作用分别是对服务器资源的增,删,改,查。 所以,get是获取数据,post是修改数据。 但是,现在大家都不这么干了! 只用一个方式就可以 阅读全文
posted @ 2018-09-26 17:52 少_年 阅读(126) 评论(0) 推荐(0) 编辑
 
摘要: Math 用于执行常用的数学任务 console.log(Math.E); 自然数底数2.718 console.log(Math.PI); 圆周率3.1415926 console.log(Math.abs(-12)); 取绝对值 console.log(Math.ceil(12.3)); 向上取 阅读全文
posted @ 2018-09-26 16:17 少_年 阅读(104) 评论(0) 推荐(0) 编辑
 
摘要: 闭包 闭包: 指的是词法表示包括不被计算的变量的函数,也就是说,函数可以使用函数之外定义的变量。 Demo: var iBaseNum = 10; function addNum(iNum1, iNum2) { function doAdd() { return iNum1 + iNum2 + iB 阅读全文
posted @ 2018-09-26 16:16 少_年 阅读(115) 评论(0) 推荐(0) 编辑