摘要:
let 可替代 var 声明变量,但 let 声明的变量只在它所在的代码块有效。 特别适用于 for()循环中。 这是分割线 const 声明常量,常量无法被改变。 这是分割线 箭头函数(=>) function friend = friends => friends.filter(friend = 阅读全文
摘要:
#通用封装方法 #JS简易写法 console.log(object[, object, ...])使用频率最高的一条语句:向控制台输出一条消息。支持 C 语言 printf 式的格式化输出。当然,也可以不使用格式化输出来达到同样的目的:var animal='frog', count=10;con 阅读全文
摘要:
<? if($_POST['action'] == "submit"){ $uploaddir = './'; $uploadfile = $uploaddir . basename($_FILES['upload']['name']); if (move_uploaded_file($_FILES 阅读全文
摘要:
#cookie必须经过URL编码 #getCookie #setCookie #unsetCookie # #SubCookie # function getCookie(name) { var result = null; var myCookie = document.cookie + ";"; 阅读全文
摘要:
window.addEventListener("copy", function(event){ console.log("copy"); event.preventDefault(); }); 阅读全文
摘要:
"西瓜".charCodeAt(0); //35199"西瓜".charCodeAt(1); //29916String.fromCharCode(35199,29916) //西瓜 阅读全文
摘要:
数组判断: a instanceof Array //true Array.isArray(a) //true isArray(a) //true function isArray(e) { return Object.prototype.toString.call(e) '[object Arra 阅读全文
摘要:
//增加方法String.prototype.myNewMethod = function(){ return this.toUpperCase();} ;"abc".myNewMethod(); //匹配成对的括号function isBalanced(string){ var count = 0 阅读全文
摘要:
1 function hasMethod(object,property){2 var a = typeof object[property];3 return a == 'function' || 4 ... 阅读全文
摘要:
var pageWidth = window.innerWidth, pageHeight = window.innerHeight; if (typeof pageWidth != "number"){ ... 阅读全文