Skip to content

Instantly share code, notes, and snippets.

View Go7hic's full-sized avatar
👓
👖

Go7hic Go7hic

👓
👖
View GitHub Profile

@kangax's ES6 quiz, explained

@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:

Question 1:
(function(x, f = () => x) {
@Go7hic
Go7hic / 📊 Weekly development breakdown
Last active October 29, 2020 01:01
📊 Weekly development breakdown
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轮",

Keybase proof

I hereby claim:

  • I am dyygtfx on github.
  • I am go7hic (https://keybase.io/go7hic) on keybase.
  • I have a public key whose fingerprint is 093F 4C3C 7FF4 7B9C DC4F D095 8C4E DA4D A4B6 F9F7

To claim this, I am signing this object:

@Go7hic
Go7hic / readRemoteFile.js
Created April 10, 2018 03:04 — forked from leizongmin/readRemoteFile.js
Node.js 读取远程文件
var http = require('http');
/**
* 读取远程文件
*
* @param {String} url
* @param {Function} cb
* - {Error} err
* - {Buffer} buf
*/
{"sig":"1e4efb648f274ba44f02cf7d426ce93dca01d4e5dc7ff75cc539d0eecadfcca9d0318e3483db5e069ce00aa0b4852340eae43dbd46b58ee630f8b31580c27c380","msghash":"57578cd28d1ce0c9f4f3f01a51bec57c4a2d5a45a24b5c7393739d0d194477f9"}
@Go7hic
Go7hic / #copyjs
Last active August 2, 2017 07:31
JS 深浅拷贝 #tags: 深浅拷贝
```
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];
      }
@Go7hic
Go7hic / regulr.js
Created February 18, 2017 10:03
常用JS正则表达式 #tags: js正则
手机号码:
@Go7hic
Go7hic / javascriptdatastructure.md
Created February 9, 2017 15:30
javascript 数据结构算法 #tags: javascript datastructure

数据结构

数据结构(英语:data structure)是计算机中存储、组织数据的方式。——维基百科

  • 数组(Array)
  • 栈(Stack)
  • 队列(Queue)
  • 链表(Linked List)
  • 集合(Set)
  • 散列表(Hash) 和 字典(Map)
  • 树(Tree)
@Go7hic
Go7hic / utils.js
Last active February 9, 2017 16:41
JS 工具函数集 #tags:jsutils
// 千位数
function commafy(num) {
num = num + '';
var reg = /(-?\d+)(\d{3})/;
while(reg.test(num)) {
num = num.replace(reg, '$1,$2');
}