文章分类 - html js css
摘要:var obj; obj == null //true obj undefined //true //判断对象是不是空{} function isEmpty(obj){ for(let key in obj){ if(obj.hasOwnProperty(key)){ return false }
阅读全文
摘要:function add(x){ if(x 1){ return 1 } return add(x-1)+x } console.log(add(3))// 6 1+2+3 function fib(b){ if(b 0 || b 1){ return 1 } return fib(b-1)+fib
阅读全文
摘要:class Person{ constructor(name) { this.name=name } say(){ console.log('hi:'+this.name) } } const p=new Person("howhy") class Student extends Person{ c
阅读全文
摘要:中文文档:https://webpack.docschina.org/ ##webpack.config.js const path = require('path');const HtmlWebpackPlugin = require('html-webpack-plugin')module.ex
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:var可以重复声明 没有作用域 浏览器预解释会自动提升 let不可以重复声明 有相应的作用域 const 常量
阅读全文
摘要:setup是在vue组件beforecreate(data和methods还没有初始化完成 vue组件还没有创建完成)和created(data和methods已初始化完成 )之间创建的
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>login</ti
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>正则</title
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:webpack打包可以自动将es6语法的js文件将为amd cmd浏览器可以使用的js文件 1、npm install webpack webpack-cli webpack-dev-server html-webpack-plugin style-loader css-loader less-lo
阅读全文
摘要:1、npm install --save-dev @babel/core @babel/cli @babel/preset-env @babel/node 2、npm install --save @babel/polyfill 3、babel.config.js文件 const presets =
阅读全文
摘要:async 修饰函数 默认返回一个Promise对象 await后是一个Promise对象并且await只能用于async函数中 var fun = async function() { return 'aaaaa' } console.log(fun())//Promise {<resolved>
阅读全文