@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
JavaScript 15 hrs 55 mins █████████████▎░░░░░░░ 63.4% | |
JSX 6 hrs 15 mins █████▏░░░░░░░░░░░░░░░ 24.9% | |
JSON 1 hr 3 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.2% | |
LESS 57 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.8% | |
HTML 28 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.9% |
window.companies = [ | |
{ | |
"companyId": 35559, | |
"companyShortName": "亲宝宝", | |
"companyFullName": "杭州点望科技有限公司", | |
"companyLogo": "i/image2/M01/CC/83/CgotOVw1nYCAXKG1AACh6SsABbA834.jpg", | |
"address": "杭州西湖区紫荆花路2号联合大厦B座3F亲宝宝", | |
"location": "120.097822,30.266052", | |
"district": "西湖区", | |
"financeStage": "C轮", |
I hereby claim:
To claim this, I am signing this object:
var http = require('http'); | |
/** | |
* 读取远程文件 | |
* | |
* @param {String} url | |
* @param {Function} cb | |
* - {Error} err | |
* - {Buffer} buf | |
*/ |
{"sig":"1e4efb648f274ba44f02cf7d426ce93dca01d4e5dc7ff75cc539d0eecadfcca9d0318e3483db5e069ce00aa0b4852340eae43dbd46b58ee630f8b31580c27c380","msghash":"57578cd28d1ce0c9f4f3f01a51bec57c4a2d5a45a24b5c7393739d0d194477f9"} |
``` | |
function deepCopy(p, c) { | |
var c = c || {}; | |
for (var i in p) { | |
if (typeof p[i] === 'object') { | |
c[i] = (p[i].constructor === Array) ? [] : {}; | |
deepCopy(p[i], c[i]); | |
} else { | |
c[i] = p[i]; | |
} |
手机号码: | |
// 千位数 | |
function commafy(num) { | |
num = num + ''; | |
var reg = /(-?\d+)(\d{3})/; | |
while(reg.test(num)) { | |
num = num.replace(reg, '$1,$2'); | |
} |