摘要:
// 一个对象里面,属性名不能重复,属性名一般是字符串,数字属性名==字符串属性名 /* let a={},b='0',c=0; a[b]='abc'; a[c]='123' console.log(a[b]) */ //考点进一步深入提问:对象和数组的区别 /* let a={},b=Symbol 阅读全文
posted @ 2020-08-08 20:12
火星_PGY
阅读(323)
评论(0)
推荐(0)
摘要:
下列代码的输出值: function A() { console.log(1) } function fn() { A = function () { console.log(2) } return this } fn.A=A fn.prototype = { A: () => { console. 阅读全文
posted @ 2020-08-08 20:03
火星_PGY
阅读(169)
评论(0)
推荐(0)
摘要:
//拆分字符串形式 function queryToObj() { const res = {} const search = location.search.substr(1);//去掉前面的“?” search.split('&').forEach(paramStr => { const arr 阅读全文
posted @ 2020-08-08 19:59
火星_PGY
阅读(580)
评论(0)
推荐(0)
摘要:
// flatern 是摊平数组 function flat(arr) { const isDeep = arr.some(item => item instanceof Array) if(!isDeep){ return arr } const result = Array.prototype. 阅读全文
posted @ 2020-08-08 19:55
火星_PGY
阅读(215)
评论(0)
推荐(0)
摘要:
下面代码输出打印值顺序: async function async1(){ console.log('async1 start'); await async2(); console.log('async1 end'); } async function async2(){ console.log(' 阅读全文
posted @ 2020-08-08 19:45
火星_PGY
阅读(242)
评论(0)
推荐(0)
摘要:
下列代码输出打印值: function Foo() { getName = function () { console.log(1); } return this; } Foo.getName = function () { console.log(2) } Foo.prototype.getNam 阅读全文
posted @ 2020-08-08 19:42
火星_PGY
阅读(232)
评论(0)
推荐(0)
摘要:
// 传统方式,遍历元素比较 function unique(arr) { const res = [] arr.forEach(item => { if (res.indexOf(item) < 0) { res.push(item) } }) return res } console.log(u 阅读全文
posted @ 2020-08-08 19:39
火星_PGY
阅读(140)
评论(0)
推荐(0)
摘要:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>手写ajax</title> </head> <body> <script> const xhr = new XMLHttpRequest(); xhr.ope 阅读全文
posted @ 2020-08-08 19:35
火星_PGY
阅读(444)
评论(0)
推荐(0)
摘要:
VUE2.0和3.0数据双向绑定的原理,并说出其区别。 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>vue2.0/3.0双向数据绑定原理</title> </head> <body> 姓名:<sp 阅读全文
posted @ 2020-08-08 18:34
火星_PGY
阅读(1422)
评论(0)
推荐(0)
摘要:
常见值类型: let a; //undefined let s = 'abc'; let n = 100; let b = true; let sb = Symbol('s'); let nn = NaN 常见引用类型: const obj = {x: 100}; const arr = [1, 2 阅读全文
posted @ 2020-08-08 18:25
火星_PGY
阅读(190)
评论(0)
推荐(0)
摘要:
如何理解语义化: 对应的内容是用相应意思的标签,增加开发者和机器爬虫对代码的可读性。 块状元素和内联元素: 块状元素有:display:block/table;有div h1 h2 table ul ol p等,这些元素特点是独占一行。 内联元素:display:inline/inline-bloc 阅读全文
posted @ 2020-08-08 17:57
火星_PGY
阅读(180)
评论(0)
推荐(0)
摘要:
前言 最近公司向员工搜集公司杂志的文章,刚好最近学习了机器学习相关课程。为了赚取购买课程的费用,所以写了如下文章投稿赚取稿费。 如下文章可能涉及一些我所购买课程的内容,所以不便将所有资源进行展示。 当初写这篇文章的目的除了赚取公司的稿费外,还有就是给现有web开发的同事提供一些新的开发方向,认识新的 阅读全文
posted @ 2020-08-08 17:05
火星_PGY
阅读(965)
评论(2)
推荐(0)

浙公网安备 33010602011771号