摘要: process.stdin.pipe(process.stdout); 阅读全文
posted @ 2017-05-15 21:33 ax=null 阅读(91) 评论(0) 推荐(0) 编辑
摘要: async function sleep(timeout) { return new Promise((resolve, reject) => { setTimeout(function() { resolve('timeout'); }, timeout); });} (async functio 阅读全文
posted @ 2017-05-15 15:39 ax=null 阅读(119) 评论(0) 推荐(0) 编辑
摘要: var obj = { valueOf: function() { return 3; }, toString: function() { return 2; }}; const sym = Symbol(obj);console.log(sym); // 'Symbol(2)' call toSt 阅读全文
posted @ 2017-05-15 11:36 ax=null 阅读(200) 评论(0) 推荐(0) 编辑
摘要: function dedupe(arr) { return Array.from(new Set(arr));} var arr = [2,2,3,4,5,4];console.log(dedupe(arr)); // [2, 3, 4, 5] 阅读全文
posted @ 2017-05-15 11:25 ax=null 阅读(108) 评论(0) 推荐(0) 编辑