Skip to main content
哈哈小老虎's Blog
code·vim·享生活!

Main menu

  • 首页

Category Archives: JS

利用字符串实现数组的复杂排序

  • By
    Tcer
  • 2010 年 3 月 27 日
  • 7 Comments

一. 场景

有这样一个数组:

[
   {inuse: '0', order: 10},
   {inuse: '1', order: 10},
   {inuse: '0', order: 9},
   {inuse: '1', order: 8},
   ...
]

Continue reading

  • Posted in JS

巧妙去除数组中的重复项

  • By
    Tcer
  • 2009 年 12 月 21 日
  • 7 Comments

时不时的看下YUI的源码, 总会有些收获.

最近, 我在看YAHOO.util.YUILoader类的源码, 其中有个排除数组重复项的方法, 让我觉得甚为巧妙, 这里分享下…

Continue reading

  • Posted in JS, 性能

三种数组复制方法的性能对比

  • By
    Tcer
  • 2009 年 12 月 8 日
  • 2 Comments

一. 三种数组复制方法

1. by slice

var arr = [1, 2, 3], copyArr;
copyArr = arr.slice();

Continue reading

  • Posted in JS
  • Tagged concat, slice

Post navigation

Newer posts

标签

attachEvent concat delete eval float function object globalEval IE6 IE7 localStorage mouseenter mouseleave new offline application cache overflow push reference relative slice

分类目录

  • JS
  • 性能
  • 浏览器