您的位置:首页 > 职场人生

笔试面试总结

2016-02-16 21:20 399 查看
1、Array API :join,pop,push,shift(从头删除),unshift(从头插入),sort,reserve(反转),slice(返回一段),splice(删除一段)

2、string API: charAt,contact,indexOf(查询字符串),lastIndexOf,match(返回匹配串),replace,slice(返回一段),split,substr

3、原生 元素(Element)节点 API:DOM节点分为 文档节点、元素节点、属性节点、文本节点、注释节点

元素节点集合对象 NodeList 是一个类数组对象其中 list.item(0)相当于 list[0]

属性:

属性:attributes,className,id,style,title

内容:childNodes,firstChild,lastChild,innerHTML,textContent

周边:previousSibling,nextSibling,parentNode

方法:

增:appendChild,cloneNode,insertBefore(新子节点,位置子节点),(createElement在document节点才有)

删:removeChild

查:getElementsByTagName,hasChildNodes(getElementsByName和getElementById在document节点才有)

改:replaceChild

属性:getAttribute(返回指定属性的值),getAttribute(返回属性节点对象),hasAttribute(存在指定属性),hasAttribute(存在属性),

removeAttribute,removeAttributeNode,setAttribute,setAttributeNode,(createAttribute在document节点才有)

4、js面向对象:

function MyClass(){

var private = 0; //私有成员

}

MyClass.prototype.public = 0; //公开成员

5、常考算法:

(1)、字符串判重,用JS对象自带的map功能
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: