2016-04-22

聚沙

Javascript eventEmitter

一大堆兼容性问题

  • Promise
  • jQuery 2.X 不支持 IE8

307 内部跳转

http 转成 https

createRandomArray

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function createRandomArray(num) {
  var list = [];

  while(1) {
    var randomNumber = Math.floor( Math.random() * num );
    if ( list.indexOf(randomNumber) === -1 ) {
      list.push(randomNumber)
    }

    if (list.length === num) break;
  }

  return list;
}

Comments