自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(3)
  • 收藏
  • 关注

原创 实现继承的两种方法

已经定义了一个Animal类,要求定义一个People类继承Animal类的属性和方法 function Animal(name,age){ this.name=name; this.age=age } Animal.prototype.intr=function(){console.log(`I'm ${this.name},I'm ${this.age}`)} 解决方法: ES5: function People(name,age,classname){ Ani

2022-04-07 22:10:44 46

原创 笔试题:定义一个函数遍历一个指定父元素下的所有后代元素(深度优先遍历算法)

function getChildren(parent){ var children=parent.children; for(var child of children){ console.log(child.nodename)//元素的标签名 if(child.children.length>0){//如果child的下级有直接子元素就对child继续调用getChildren argument.callee(ch.

2022-04-07 21:31:58 89

原创 JS 判断对象obj1是不是数组的7种方法

//判断爹 prototype 三种 1. obj1.__proto__==Array.prototype 2. Object.getPrototypeOf(obj1)==Array.prototype 3. Array.prototype.isPrototypeOf(obj1) //判断妈妈constructor 两种 1. obj1.constructor==Array //通过原型链调用prototype的constructor 属性 2.obj1...

2022-04-03 19:19:21 212

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除