晴明的博客园 GitHub      CodePen      CodeWars     
摘要: 排序 sort() 最好在sort()使用使用函数判断,不然遇到相同值时,排序会出错 阅读全文
posted @ 2016-02-23 18:17 晴明桑 阅读(127) 评论(0) 推荐(0) 编辑
摘要: //window.location function parseURL(url) { var a = document.createElement('a'); a.href = url; return { source: url, protocol: a.protocol.replace(':',' 阅读全文
posted @ 2016-02-23 17:47 晴明桑 阅读(128) 评论(0) 推荐(0) 编辑
摘要: ok( truthy [, message ] ) //truthy结果true则显示message信息 1 QUnit.test("ok test", function(assert) { 2 assert.ok(true, "true succeeds"); 3 assert.ok("non-e 阅读全文
posted @ 2016-02-23 16:48 晴明桑 阅读(188) 评论(0) 推荐(0) 编辑
摘要: #宝宝心里苦啊 1 function findMissingNumber(sequence) { 2 // if (typeof sequence != 'string') { 3 // return 0; 4 // } 5 // if (sequence.replace(/\s+/g, '').l 阅读全文
posted @ 2016-02-23 12:54 晴明桑 阅读(225) 评论(0) 推荐(0) 编辑