1.概述 你使用了一个他人提供的对象,但又想为这个对象添加新的方法(mixin 模式),新方法的名字就有可能与现有方法产生冲突。 let s = Symbol(); typeof s let s1 =Symbol('foo') s1 //Symbol(foo) s1.toString() // 'S ...
分类:
其他好文 时间:
2019-12-29 00:55:39
阅读次数:
85
Using Symbol.iterator, you can create custom iterators that can be used inside of for loops and Array spreads. This lesson walks you through creating ...
分类:
编程语言 时间:
2019-12-28 13:31:41
阅读次数:
85
F12查看,发现报错:Unhandled promise rejection ReferenceError: “Symbol”未定义 1、安装Babel Polyfill npm install --save-dev webpack-server 2、main.js import "babel-po ...
分类:
其他好文 时间:
2019-12-26 12:58:20
阅读次数:
126
JavaScript共有7种数据类型: number string boolean null undefined obj Symbol 前5种存在栈中,栈中变量名存储的是值,object存在堆中(对象数值类型也存储在堆中),栈中变量名存储的是堆中的地址 obj1 = obj; obj1拿到的是obj ...
分类:
编程语言 时间:
2019-12-26 09:51:33
阅读次数:
85
计算机如何读懂四则运算表达式?9.3 + (3 - -0.11) * 5 后缀表达式人类习惯的数学表达式叫做中缀表达式另外,还有一种将运算符放在数字后面的后缀表达式5 + 3——> 5 3 +1 + 2 * 3 ——> 1 2 3 * +9 + (3 - 1) *5 ——> 9 3 1 - 5* + ...
分类:
编程语言 时间:
2019-12-25 01:38:53
阅读次数:
112
数组扁平化 把数字转换成中文 转换驼峰命名 合并两个有序的数组 分糖果(最大糖果的种类数) 递归= 动态规划 js const object1 = { property1: 42 }; object1[Symbol.unscopables] = { property1: true }; with ( ...
分类:
其他好文 时间:
2019-12-24 11:49:17
阅读次数:
93
# -*- coding: utf-8 -*- import requests from lxml import etree import pandas as pd import tushare as ts from redis import Redis import hashlib import ...
分类:
其他好文 时间:
2019-12-24 09:25:50
阅读次数:
75
由于项目的服务器分布在重庆,上海,台北,休斯顿,所以需要做异地容灾需求。当前的mysql,redis cluster,elastic search都在重庆的如果重庆停电了,整个应用都不能用了。 现在考虑第一步做重庆和上海的异地容灾,大概测试了一下重庆的几台服务器之间大概是13m/s的传输速度也就是说 ...
分类:
其他好文 时间:
2019-12-23 18:58:08
阅读次数:
151
Description Given an integer array nums with all positive numbers and no duplicates, find the number of possible combinations that add up to a positiv ...
分类:
其他好文 时间:
2019-12-21 22:30:21
阅读次数:
119
Description Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), guarantee that at least one duplicate num ...
分类:
其他好文 时间:
2019-12-21 20:53:19
阅读次数:
114