JS
常用方法
js中字符串常用方法总结_15种常见js字符串用法_<a href="#">leo</a>的博客-CSDN博客
<script>
var str="heool"
console.log(str.length);
console.log(str.concat(" lyt"));
console.log(str.includes("he"));
var phone="153884099001";
console.log(phone.match(/^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/));
var ls="2033 03 05"
console.log(ls.replaceAll(" ", "-"));
console.log(str.substring(1, 3));
</script>
常见数据类型及判断
typeof
console.log(typeof 123); // "number"
console.log(typeof "hello"); // "string"
console.log(typeof true); // "boolean"
console.log(typeof undefined); // "undefined"
console.log(typeof null); // "object"
console.log(typeof {}); // "object"
console.log(typeof []); // "object"
console.log(typeof function(){}); // "function"
console.log(typeof null); // "object"
console.log(typeof NaN); // "number"
console.log(typeof document.all); // "undefined"
instanceof
const arr = [1, 2, 3]
console.log(arr instanceof Array) // true
console.log(arr instanceof Object) // true
const obj = { name: "云牧", age: 18 }
console.log(obj instanceof Object) // true
console.log(obj instanceof Array) // false
jQuery
jQuery 教程 | 菜鸟教程 (runoob.com)