1)JS自身提供的方式 用于对数据进行简便的操作,根据方法可以操作的数据类型不同,形成了不同的对象 内置对象 2)数组 ? a)基本操作方法 对数组进行修改 ? b)操作方法 ? c)位置方法 IE9以下不支持 ? 问题:如果在一个数组中具有多个满足条件的元素,需要多次使用indexof ? d)排 ...
分类:
Web程序 时间:
2018-04-06 17:32:33
阅读次数:
196
charAt() 方法可返回指定位置的字符。 stringObject.charAt(index) indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置。 stringObject.indexOf(searchvalue, fromindex) substring() 方法用于提... ...
分类:
编程语言 时间:
2018-04-04 21:20:27
阅读次数:
210
String对象常用的API:API指应用程序编程接口,实际上就是一些提前预设好的方法。 charAt() 方法可返回指定位置的字符。 stringObject.charAt(index) indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置。 stringObject.inde ...
什么是codemirror已经codemirror能干什么在这就不多说了,直接看官方文档http://codemirror.net/。首先去现在一个最新的codemirror:http://codemirror.net/codemirror.zip codemirror自身提供了一个可复用的sql ...
分类:
其他好文 时间:
2018-04-03 19:19:05
阅读次数:
1085
Jquery 数组常用操作 参考博客:http://www.jb51.net/article/43164.htm 1. $.each(array, [callback]) 遍历[常用] 解释: 不同于遍历JQuery 对象的 $().each() 方法,此方法可用于遍例任何对象(不仅仅是数组). 回 ...
分类:
编程语言 时间:
2018-04-01 11:52:43
阅读次数:
175
常用的api 1、$() document.querySelector() 2、$$() document.querySelectorAll() 3、$x() xpath选择器 实战: ...
分类:
其他好文 时间:
2018-04-01 11:52:16
阅读次数:
196
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2018-03-31 20:41:46
阅读次数:
130
方式1:const unique = (value, index, arr) => { return arr.indexOf(value) === index; } const sampleValues = [1, 4, 5, 2, 'a', 'e', 'b', 'e', 2, 2, 4]; con... ...
分类:
编程语言 时间:
2018-03-31 18:38:06
阅读次数:
170
查找的效率与比较次数密切相关。基于比较的程序,运算效率是比较低的。比如平时可以通过indexOf查找一个数据。但这是一个基于比较的一个实现。如果是淘宝那样有上亿个商品,那么用indeOf 来查数据就会性能非常差。 对一个在哈希表中的数据的访问过程是迅速有效的,通过散列函数,哈希表中的元素的key经常 ...
分类:
编程语言 时间:
2018-03-31 00:51:52
阅读次数:
243
1 如果数组中存在 item,则返回元素在数组中的位置,否则返回 -1 function indexOf(arr, item) { if(Array.prototype.indexOf){ return arr.indexOf(item); }else{ for(var i=0;i<arr.leng ...
分类:
Web程序 时间:
2018-03-30 20:10:36
阅读次数:
290