mirror of
https://github.com/RealKai42/qwerty-learner.git
synced 2026-04-05 14:29:04 +08:00
feat(js api):添加js的一些api
This commit is contained in:
16708
package-lock.json
generated
Normal file
16708
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,6 @@
|
||||
"react-scripts": "4.0.1",
|
||||
"react-timer-hook": "^2.0.7",
|
||||
"source-map-explorer": "^2.5.2",
|
||||
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
|
||||
"typescript": "^4.0.3",
|
||||
"use-sound": "^2.0.1",
|
||||
"web-vitals": "^0.2.4"
|
||||
@@ -88,5 +87,8 @@
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
218
public/dicts/js-array.json
Normal file
218
public/dicts/js-array.json
Normal file
@@ -0,0 +1,218 @@
|
||||
[
|
||||
{
|
||||
"name": "Array.from()",
|
||||
"trans": [
|
||||
"Array.from() 方法从一个类似数组或可迭代对象中创建一个新的数组实例。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Array.isArray()",
|
||||
"trans": [
|
||||
"Array.isArray() 用于确定传递的值是否是一个 Array。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Array.observe()",
|
||||
"trans": [
|
||||
"Array.observe() 方法用于异步监视数组发生的变化,类似于针对对象的 Object.observe() 。当数组的值发生变化时,它按发生顺序提供了一个变化流。与 Object.observe() 类似,它由如下可接受的变化类型列表['add'、'update'、'delete'、'splice']触发。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Array.of()",
|
||||
"trans": [
|
||||
"Array.of() 方法创建一个具有可变数量参数的新数组实例,而不考虑参数的数量或类型。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "concat()",
|
||||
"trans": [
|
||||
"concat() 方法用于合并两个或多个数组。此方法不会更改现有数组,而是返回一个新数组。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "copyWithin()",
|
||||
"trans": [
|
||||
"改变了的数组。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "entries()",
|
||||
"trans": [
|
||||
"entries() 方法返回一个新的Array Iterator对象,该对象包含数组中每个索引的键/值对。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "every()",
|
||||
"trans": [
|
||||
"every() 方法测试数组的所有元素是否都通过了指定函数的测试。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fill()",
|
||||
"trans": [
|
||||
"fill() 方法用一个固定值填充一个数组中从起始索引到终止索引内的全部元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "filter()",
|
||||
"trans": [
|
||||
"filter() 方法创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "find()",
|
||||
"trans": [
|
||||
"find() 方法返回数组中满足提供的测试函数的第一个元素的值。否则返回 undefined。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "findIndex()",
|
||||
"trans": [
|
||||
"findIndex()方法返回数组中满足提供的测试函数的第一个元素的索引。否则返回-1。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "flat()",
|
||||
"trans": [
|
||||
"flat() 方法会递归到指定深度将所有子数组连接,并返回一个新数组。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "flatMap()",
|
||||
"trans": [
|
||||
"flatMap()方法首先使用映射函数映射每个元素,然后将结果压缩成一个新数组。它与 map 和 深度值1的 flatten 几乎相同,但flatMap通常在合并成一种方法的效率稍微高一些。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "forEach()",
|
||||
"trans": [
|
||||
"forEach() 方法对数组的每个元素执行一次提供的函数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "includes()",
|
||||
"trans": [
|
||||
"includes() 方法用来判断一个数组是否包含一个指定的值,根据情况,如果包含则返回 true,否则返回false。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "indexOf()",
|
||||
"trans": [
|
||||
"indexOf()方法返回在数组中可以找到一个给定元素的第一个索引,如果不存在,则返回-1。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "join()",
|
||||
"trans": [
|
||||
"join() 方法将一个数组(或一个类数组对象)的所有元素连接成一个字符串并返回这个字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "keys()",
|
||||
"trans": [
|
||||
"keys() 方法返回一个新的Array迭代器,它包含数组中每个索引的键。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "lastIndexOf()",
|
||||
"trans": [
|
||||
"lastIndexOf() 方法返回指定元素(也即有效的 JavaScript 值或变量)在数组中的最后一个的索引,如果不存在则返回 -1。从数组的后面向前查找,从 fromIndex 处开始。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "map()",
|
||||
"trans": [
|
||||
"map() 方法创建一个新数组,其结果是该数组中的每个元素都调用一个提供的函数后返回的结果。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "pop()",
|
||||
"trans": [
|
||||
"pop()方法从数组中删除最后一个元素,并返回该元素的值。此方法更改数组的长度。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "push()",
|
||||
"trans": [
|
||||
"push() 方法将一个或多个元素添加到数组的末尾,并返回新数组的长度。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "reduce()",
|
||||
"trans": [
|
||||
"reduce() 方法对累加器和数组中的每个元素(从左到右)应用一个函数,将其减少为单个值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "reduceRight()",
|
||||
"trans": [
|
||||
"reduceRight() 方法接受一个函数作为累加器(accumulator)和数组的每个值(从右到左)将其减少为单个值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "reverse()",
|
||||
"trans": [
|
||||
"reverse() 方法将数组中元素的位置颠倒。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "shift()",
|
||||
"trans": [
|
||||
"shift() 方法从数组中删除第一个元素,并返回该元素的值。此方法更改数组的长度。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "slice()",
|
||||
"trans": [
|
||||
"slice() 方法返回一个从开始到结束(不包括结束)选择的数组的一部分浅拷贝到一个新数组对象。且原始数组不会被修改。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "some()",
|
||||
"trans": [
|
||||
"some() 方法测试数组中的某些元素是否通过由提供的函数实现的测试。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "sort()",
|
||||
"trans": [
|
||||
"sort() 方法用就地( in-place )的算法对数组的元素进行排序,并返回数组。 sort 排序不一定是稳定的。默认排序顺序是根据字符串Unicode码点。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "splice()",
|
||||
"trans": [
|
||||
"splice() 方法通过删除现有元素和/或添加新元素来更改一个数组的内容。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleString()",
|
||||
"trans": [
|
||||
"toLocaleString() 返回一个字符串表示数组中的元素。数组中的元素将使用各自的 toLocaleString 方法转成字符串,这些字符串将使用一个特定语言环境的字符串(例如一个逗号 ',')隔开。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toSource()",
|
||||
"trans": [
|
||||
"返回一个字符串,代表该数组的源代码."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toString()",
|
||||
"trans": [
|
||||
"toString() 返回一个字符串,表示指定的数组及其元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "unshift()",
|
||||
"trans": [
|
||||
"unshift() 方法将一个或多个元素添加到数组的开头,并返回新数组的长度。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "values()",
|
||||
"trans": [
|
||||
"values() 方法返回一个新的 Array Iterator 对象,该对象包含数组每个索引的值"
|
||||
]
|
||||
}
|
||||
]
|
||||
206
public/dicts/js-date.json
Normal file
206
public/dicts/js-date.json
Normal file
@@ -0,0 +1,206 @@
|
||||
[
|
||||
{
|
||||
"name": "Date.UTC()",
|
||||
"trans": [
|
||||
"Date.UTC() 方法接受的参数同日期构造函数接受最多参数时一样,返回从1970-1-1 00:00:00 UTC到指定日期的的毫秒数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Date.now()",
|
||||
"trans": [
|
||||
"Date.now() 方法返回自1970年1月1日 00:00:00 UTC到当前时间的毫秒数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Date.parse()",
|
||||
"trans": [
|
||||
"Date.parse() 方法解析一个表示某个日期的字符串,并返回从1970-1-1 00:00:00 UTC 到该日期对象(该日期对象的UTC时间)的毫秒数,如果该字符串无法识别,或者一些情况下,包含了不合法的日期数值(如:2015-02-31),则返回值为NaN。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getDate()",
|
||||
"trans": [
|
||||
"根据本地时间,返回一个指定的日期对象为一个月中的第几天。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getDay()",
|
||||
"trans": [
|
||||
"getDay() 方法根据本地时间,返回一个具体日期中一周的第几天,0 表示星期天。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getFullYear()",
|
||||
"trans": [
|
||||
"getFullYear() 方法根据本地时间返回指定日期的年份。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getHours()",
|
||||
"trans": [
|
||||
"getHours() 方法根据本地时间,返回一个指定的日期对象的小时。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getMilliseconds()",
|
||||
"trans": [
|
||||
"getMilliseconds() 方法,根据本地时间,返回一个指定的日期对象的毫秒数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getMinutes()",
|
||||
"trans": [
|
||||
"getMinutes() 方法根据本地时间,返回一个指定的日期对象的分钟数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getMonth()",
|
||||
"trans": [
|
||||
"根据本地时间,返回一个指定的日期对象的月份,为基于0的值(0表示一年中的第一月)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getSeconds()",
|
||||
"trans": [
|
||||
"getSeconds() 方法根据本地时间,返回一个指定的日期对象的秒数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getTime()",
|
||||
"trans": [
|
||||
"getTime() 方法返回一个时间的格林威治时间数值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getTimezoneOffset()",
|
||||
"trans": [
|
||||
"getTimezoneOffset() 方法返回协调世界时(UTC)相对于当前时区的时间差值,单位为分钟。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "getYear()",
|
||||
"trans": [
|
||||
"getYear() 方法返回指定的本地日期的年份。因为 getYear 不返回千禧年[full years] ('year 2000 problem'),所以这个方法不再被使用,现在替换为 getFullYear ."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setDate()",
|
||||
"trans": [
|
||||
"setDate() 方法根据本地时间来指定一个日期对象的天数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setFullYear()",
|
||||
"trans": [
|
||||
"setFullYear() 方法根据本地时间为一个日期对象设置年份。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setHours()",
|
||||
"trans": [
|
||||
"setHours() 方法根据本地时间为一个日期对象设置小时数,返回从1970-01-01 00:00:00 UTC 到更新后的 日期 对象实例所表示时间的毫秒数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setMilliseconds()",
|
||||
"trans": [
|
||||
"setMilliseconds() 方法会根据本地时间设置一个日期对象的豪秒数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setMinutes()",
|
||||
"trans": [
|
||||
"setMinutes() 方法根据本地时间为一个日期对象设置分钟数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setMonth()",
|
||||
"trans": [
|
||||
"setMonth() 方法根据本地时间为一个设置年份的日期对象设置月份。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setSeconds()",
|
||||
"trans": [
|
||||
"setSeconds() 方法根据本地时间设置一个日期对象的秒数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setTime()",
|
||||
"trans": [
|
||||
"setTime() 方法以一个表示从1970-1-1 00:00:00 UTC计时的毫秒数为来为 Date 对象设置时间。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "setYear()",
|
||||
"trans": [
|
||||
"The setYear() method sets the year for a specified date according to local time. Because setYear does not set full years ('year 2000 problem'), it is no longer used and has been replaced by the setFullYear method."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toDateString()",
|
||||
"trans": [
|
||||
"toDateString() 方法以美式英语和人类易读的形式返回一个日期对象日期部分的字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toGMTString()",
|
||||
"trans": [
|
||||
"The toGMTString() method converts a date to a string, using Internet GMT conventions. The exact format of the value returned by toGMTString varies according to the platform and browser, in general it should represent a human readable date string."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toISOString()",
|
||||
"trans": [
|
||||
"toISOString() 方法返回一个 ISO(ISO 8601 Extended Format)格式的字符串: YYYY-MM-DDTHH:mm:ss.sssZ。时区总是UTC(协调世界时),加一个后缀“Z”标识。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toJSON()",
|
||||
"trans": [
|
||||
"toJSON() 方法返回 Date 对象的字符串形式。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleDateString()",
|
||||
"trans": [
|
||||
"toLocaleDateString() 方法返回该日期对象日期部分的字符串,该字符串格式因不同语言而不同。新增的参数 locales 和 options 使程序能够指定使用哪种语言格式化规则,允许定制该方法的表现(behavior)。在旧版本浏览器中, locales 和 options 参数被忽略,使用的语言环境和返回的字符串格式是各自独立实现的。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleFormat()",
|
||||
"trans": [
|
||||
"非标准方法 toLocaleFormat() 按特定的格式将一个日期转换成一个字符串。 Intl.DateTimeFormat 是符合标准的格式化日期的替代方法。另见更新的(newer)版本的 toLocaleDateString()方法."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleString()",
|
||||
"trans": [
|
||||
"toLocaleString() 方法返回该日期对象的字符串,该字符串格式因不同语言而不同。新增的参数 locales 和 options 使程序能够指定使用哪种语言格式化规则,允许定制该方法的表现(behavior)。在旧版本浏览器中, locales 和 options 参数被忽略,使用的语言环境和返回的字符串格式是各自独立实现的。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleTimeString()",
|
||||
"trans": [
|
||||
"The toLocaleTimeString() 方法返回该日期对象时间部分的字符串,该字符串格式因不同语言而不同。新增的参数 locales 和 options 使程序能够指定使用哪种语言格式化规则,允许定制该方法的表现(behavior)。在旧版本浏览器中, locales 和 options 参数被忽略,使用的语言环境和返回的字符串格式是各自独立实现的。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toSource()",
|
||||
"trans": [
|
||||
"toSource() 返回表示源代码的字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toString()",
|
||||
"trans": [
|
||||
"toString() 方法返回一个字符串,表示该Date对象。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toTimeString()",
|
||||
"trans": [
|
||||
"toTimeString() 方法以人类易读形式返回一个日期对象时间部分的字符串,该字符串以美式英语格式化。"
|
||||
]
|
||||
}
|
||||
]
|
||||
56
public/dicts/js-global.json
Normal file
56
public/dicts/js-global.json
Normal file
@@ -0,0 +1,56 @@
|
||||
[
|
||||
{
|
||||
"name": "eval()",
|
||||
"trans": [
|
||||
"eval() 函数会将传入的字符串当做 JavaScript 代码进行执行。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "isFinite()",
|
||||
"trans": [
|
||||
"该全局 isFinite() 函数用来判断被传入的参数值是否为一个有限数值(finite number)。在必要情况下,参数会首先转为一个数值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "isNaN()",
|
||||
"trans": [
|
||||
"isNaN() 函数用来确定一个值是否为NaN 。注:isNaN函数内包含一些非常有趣的规则;你也可以使用 ECMAScript 2015 中定义的 Number.isNaN() 来判断。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "parseFloat()",
|
||||
"trans": [
|
||||
"parseFloat() 函数解析一个参数(必要时先转换为字符串)并返回一个浮点数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "parseInt()",
|
||||
"trans": [
|
||||
"parseInt(string, radix) 将一个字符串 string 转换为 radix 进制的整数, radix 为介于2-36之间的数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "decodeURI()",
|
||||
"trans": [
|
||||
"decodeURI() 函数解码一个由encodeURI 先前创建的统一资源标识符(URI)或类似的例程。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "decodeURIComponent()",
|
||||
"trans": [
|
||||
"decodeURIComponent() 方法用于解码由 encodeURIComponent 方法或者其它类似方法编码的部分统一资源标识符(URI)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "encodeURI()",
|
||||
"trans": [
|
||||
"encodeURI() 函数通过将特定字符的每个实例替换为一个、两个、三或四转义序列来对统一资源标识符 (URI) 进行编码 (该字符的 UTF-8 编码仅为四转义序列)由两个 \"代理\" 字符组成)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "encodeURIComponent()",
|
||||
"trans": [
|
||||
"encodeURIComponent()是对统一资源标识符(URI)的组成部分进行编码的方法。它使用一到四个转义序列来表示字符串中的每个字符的UTF-8编码(只有由两个Unicode代理区字符组成的字符才用四个转义字符编码)。"
|
||||
]
|
||||
}
|
||||
]
|
||||
98
public/dicts/js-map-set.json
Normal file
98
public/dicts/js-map-set.json
Normal file
@@ -0,0 +1,98 @@
|
||||
[
|
||||
{
|
||||
"name": "clear()",
|
||||
"trans": [
|
||||
"clear()方法会移除Map对象中的所有元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "delete()",
|
||||
"trans": [
|
||||
" delete() 方法用于移除 Map 对象中指定的元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "entries()",
|
||||
"trans": [
|
||||
"entries() 方法返回一个新的包含 [key, value] 对的 Iterator 对象,返回的迭代器的迭代顺序与 Map 对象的插入顺序相同。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "forEach()",
|
||||
"trans": [
|
||||
"forEach() 方法将会以插入顺序对 Map 对象中的每一个键值对执行一次参数中提供的回调函数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "get()",
|
||||
"trans": [
|
||||
"get() 方法返回某个 Map 对象中的一个指定元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "has()",
|
||||
"trans": [
|
||||
"方法has() 返回一个bool值,用来表明map 中是否存在指定元素."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "keys()",
|
||||
"trans": [
|
||||
"keys() 返回一个新的 Iterator 对象。它包含按照顺序插入 Map 对象中每个元素的key值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "set()",
|
||||
"trans": [
|
||||
"set() 方法为 Map 对象添加或更新一个指定了键(key)和值(value)的(新)键值对。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "values()",
|
||||
"trans": [
|
||||
"一个新的 Map 可迭代对象."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "add()",
|
||||
"trans": [
|
||||
"add() 方法用来向一个 Set 对象的末尾添加一个指定的值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "clear()",
|
||||
"trans": [
|
||||
"clear() 方法用来清空一个 Set 对象中的所有元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "delete()",
|
||||
"trans": [
|
||||
"delete() 方法可以从一个 Set 对象中删除指定的元素。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "entries()",
|
||||
"trans": [
|
||||
"entries() 方法返回一个新的迭代器对象 ,这个对象的元素是类似 [value, value] 形式的数组,value 是集合对象中的每个元素,迭代器对象元素的顺序即集合对象中元素插入的顺序。由于集合对象不像 Map 对象那样拥有 key,然而,为了与 Map 对象的 API 形式保持一致,故使得每一个 entry 的 key 和 value 都拥有相同的值,因而最终返回一个 [value, value] 形式的数组。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "forEach()",
|
||||
"trans": [
|
||||
"forEach 方法会根据集合中元素的插入顺序,依次执行提供的回调函数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "has()",
|
||||
"trans": [
|
||||
"has() 方法返回一个布尔值来指示对应的值value是否存在Set对象中。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "values()",
|
||||
"trans": [
|
||||
"values() 方法返回一个 Iterator 对象,该对象按照原Set 对象元素的插入顺序返回其所有元素。"
|
||||
]
|
||||
}
|
||||
]
|
||||
230
public/dicts/js-math.json
Normal file
230
public/dicts/js-math.json
Normal file
@@ -0,0 +1,230 @@
|
||||
[
|
||||
{
|
||||
"name": "Math.PI",
|
||||
"trans": [
|
||||
"Math.PI 表示一个圆的周长与直径的比例,约为 3.14159:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.SQRT1_2",
|
||||
"trans": [
|
||||
"Math.SQRT1_2 属性表示 1/2 的平方根,约为 0.707:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.SQRT2",
|
||||
"trans": [
|
||||
"Math.SQRT2 属性表示 2 的平方根,约为 1.414:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.abs()",
|
||||
"trans": [
|
||||
"Math.abs(x) 函数返回指定数字 “x“ 的绝对值。如下:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.acos()",
|
||||
"trans": [
|
||||
"Math.acos() 返回一个数的反余弦值(单位为弧度),即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.acosh()",
|
||||
"trans": [
|
||||
"Math.acosh()返回一个数字的反双曲余弦值,即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.asin()",
|
||||
"trans": [
|
||||
"Math.asin() 方法返回一个数值的反正弦(单位为弧度),即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.asinh()",
|
||||
"trans": [
|
||||
"Math.asinh() 函数返回给定数字的反双曲正弦值, 即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.atan()",
|
||||
"trans": [
|
||||
"Math.atan() 函数返回一个数值的反正切(以弧度为单位),即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.atan2()",
|
||||
"trans": [
|
||||
"Math.atan2() 返回其参数比值的反正切值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.atanh()",
|
||||
"trans": [
|
||||
"Math.atanh() 函数返回一个数值反双曲正切值, 即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.cbrt()",
|
||||
"trans": [
|
||||
"Math.cbrt() 函数返回任意数字的立方根."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.ceil()",
|
||||
"trans": [
|
||||
"Math.ceil() 函数返回大于或等于一个给定数字的最小整数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.clz32()",
|
||||
"trans": [
|
||||
"Math.clz32() 函数返回一个数字在转换成 32 无符号整形数字的二进制形式后, 开头的 0 的个数, 比如 1000000 转换成 32 位无符号整形数字的二进制形式后是 00000000000011110100001001000000, 开头的 0 的个数是 12 个, 则 Math.clz32(1000000) 返回 12."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.cos()",
|
||||
"trans": [
|
||||
"Math.cos() 函数返回一个数值的余弦值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.cosh()",
|
||||
"trans": [
|
||||
"Math.cosh() 函数返回数值的双曲余弦函数, 可用 constant e 表示:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.exp()",
|
||||
"trans": [
|
||||
"Math.exp() 函数返回 ex,x 表示参数,e 是欧拉常数(Euler's constant),自然对数的底数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.expm1()",
|
||||
"trans": [
|
||||
"Math.expm1() 函数返回 Ex - 1, 其中 x 是该函数的参数, E 是自然对数的底数 2.718281828459045."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.floor()",
|
||||
"trans": [
|
||||
"Math.floor() 返回小于或等于一个给定数字的最大整数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.fround()",
|
||||
"trans": [
|
||||
"Math.fround() 可以将任意的数字转换为离它最近的单精度浮点数形式的数字。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.hypot()",
|
||||
"trans": [
|
||||
"Math.hypot() 函数返回它的所有参数的平方和的平方根,即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.imul()",
|
||||
"trans": [
|
||||
"该函数返回两个参数的类C的32位整数乘法运算的运算结果."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.log()",
|
||||
"trans": [
|
||||
"Math.log() 函数返回一个数的自然对数,即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.log10()",
|
||||
"trans": [
|
||||
"Math.log10() 函数返回一个数字以 10 为底的对数."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.log1p()",
|
||||
"trans": [
|
||||
"Math.log1p() 函数返回一个数字加1后的自然对数 (底为 E), 既log(x+1)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.log2()",
|
||||
"trans": [
|
||||
"Math.log2() 函数返回一个数字以 2 为底的对数."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.max()",
|
||||
"trans": [
|
||||
"Math.max() 函数返回一组数中的最大值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.min()",
|
||||
"trans": [
|
||||
"Math.min() 返回零个或更多个数值的最小值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.pow()",
|
||||
"trans": [
|
||||
"Math.pow() 函数返回基数(base)的指数(exponent)次幂,即 baseexponent。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.random()",
|
||||
"trans": [
|
||||
"Math.random() 函数返回一个浮点, 伪随机数在范围[0,1),也就是说,从0(包括0)往上,但是不包括1(排除1),然后您可以缩放到所需的范围。实现将初始种子选择到随机数生成算法;它不能被用户选择或重置。他不能被用户选择或重置。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.round()",
|
||||
"trans": [
|
||||
"Math.round() 函数返回一个数字四舍五入后最接近的整数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.sign()",
|
||||
"trans": [
|
||||
"Math.sign() 函数返回一个数字的符号, 指示数字是正数,负数还是零。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.sin()",
|
||||
"trans": [
|
||||
"Math.sin() 函数返回一个数值的正弦值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.sinh()",
|
||||
"trans": [
|
||||
"Math.sinh() 函数返回一个数字(单位为角度)的双曲正弦值."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.sqrt()",
|
||||
"trans": [
|
||||
"Math.sqrt() 函数返回一个数的平方根,即:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.tan()",
|
||||
"trans": [
|
||||
"Math.tan() 方法返回一个数值的正切值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.tanh()",
|
||||
"trans": [
|
||||
"Math.tanh() 函数将会返回一个数的双曲正切函数值,计算如下:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Math.trunc()",
|
||||
"trans": [
|
||||
"Math.trunc() 方法会将数字的小数部分去掉,只保留整数部分。"
|
||||
]
|
||||
}
|
||||
]
|
||||
134
public/dicts/js-number.json
Normal file
134
public/dicts/js-number.json
Normal file
@@ -0,0 +1,134 @@
|
||||
[
|
||||
{
|
||||
"name": "Number.EPSILON",
|
||||
"trans": [
|
||||
"Number.EPSILON 属性表示 1 和大于 1 的最小的浮点数(可表示为 Number)的差值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.MAX_SAFE_INTEGER",
|
||||
"trans": [
|
||||
"Number.MAX_SAFE_INTEGER 常量表示在 JavaScript 中最大的安全整数(maxinum safe integer)(253 - 1)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.MAX_VALUE",
|
||||
"trans": [
|
||||
"Number.MAX_VALUE 属性表示在 JavaScript 里所能表示的最大数值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.MIN_SAFE_INTEGER",
|
||||
"trans": [
|
||||
"Number.MIN_SAFE_INTEGER 代表在 JavaScript中最小的安全的integer型数字 (-(253 - 1))."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.MIN_VALUE",
|
||||
"trans": [
|
||||
"Number.MIN_VALUE 属性表示在 JavaScript 中所能表示的最小的正值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.NEGATIVE_INFINITY",
|
||||
"trans": [
|
||||
"Number.NEGATIVE_INFINITY 属性表示负无穷大。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.NaN",
|
||||
"trans": [
|
||||
"Number.NaN 表示“非数字”(Not-A-Number)。和 NaN 相同。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.POSITIVE_INFINITY",
|
||||
"trans": [
|
||||
"Number.POSITIVE_INFINITY 属性表示正无穷大。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.isFinite()",
|
||||
"trans": [
|
||||
"Number.isFinite() 方法用来检测传入的参数是否是一个有穷数(finite number)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.isInteger()",
|
||||
"trans": [
|
||||
"Number.isInteger() 方法用来判断给定的参数是否为整数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.isNaN()",
|
||||
"trans": [
|
||||
"Number.isNaN() 方法确定传递的值是否为 NaN和其类型是 Number。它是原始的全局isNaN()的更强大的版本。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.isSafeInteger()",
|
||||
"trans": [
|
||||
"Number.isSafeInteger() 方法用来判断传入的参数值是否是一个“安全整数”(safe integer)。一个安全整数是一个符合下面条件的整数:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.parseFloat()",
|
||||
"trans": [
|
||||
"Number.parseFloat() 方法可以把一个字符串解析成浮点数。该方法与全局的 parseFloat() 函数相同,并且处于 ECMAScript 6 规范中(用于全局变量的模块化)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.parseInt()",
|
||||
"trans": [
|
||||
"Number.parseInt() 方法可以根据给定的进制数把一个字符串解析成整数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toExponential()",
|
||||
"trans": [
|
||||
"toExponential() 方法以指数表示法返回该数值字符串表示形式。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toFixed()",
|
||||
"trans": [
|
||||
"toFixed() 方法使用定点表示法来格式化一个数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleString()",
|
||||
"trans": [
|
||||
"toLocaleString() 方法返回这个数字在特定语言环境下的表示字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toPrecision()",
|
||||
"trans": [
|
||||
"toPrecision() 方法以指定的精度返回该数值对象的字符串表示。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toSource()",
|
||||
"trans": [
|
||||
"toSource() 方法返回该对象源码的字符串表示。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toString()",
|
||||
"trans": [
|
||||
"toString() 方法返回指定 Number 对象的字符串表示形式。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "valueOf()",
|
||||
"trans": [
|
||||
"valueOf() 方法返回一个被 Number 对象包装的原始值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Number.toInteger()",
|
||||
"trans": [
|
||||
"Number.toInteger() 用来将参数转换成整数,但该方法的实现已被移除."
|
||||
]
|
||||
}
|
||||
]
|
||||
224
public/dicts/js-object.json
Normal file
224
public/dicts/js-object.json
Normal file
@@ -0,0 +1,224 @@
|
||||
[
|
||||
{
|
||||
"name": "Object.assign()",
|
||||
"trans": [
|
||||
"Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象。它将返回目标对象。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.create()",
|
||||
"trans": [
|
||||
"Object.create()方法创建一个新对象,使用现有的对象来提供新创建的对象的__proto__。 (请查看浏览器控制台以获取视觉证据。)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.defineProperties()",
|
||||
"trans": [
|
||||
"Object.defineProperties() 方法直接在一个对象上定义新的属性或修改现有属性,并返回该对象。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.defineProperty()",
|
||||
"trans": [
|
||||
"Object.defineProperty() 方法会直接在一个对象上定义一个新属性,或者修改一个对象的现有属性, 并返回这个对象。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.entries()",
|
||||
"trans": [
|
||||
"The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.freeze()",
|
||||
"trans": [
|
||||
"Object.freeze() 方法可以冻结一个对象,冻结指的是不能向这个对象添加新的属性,不能修改其已有属性的值,不能删除已有属性,以及不能修改该对象已有属性的可枚举性、可配置性、可写性。也就是说,这个对象永远是不可变的。该方法返回被冻结的对象。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.getNotifier()",
|
||||
"trans": [
|
||||
"Object.getNotifer() 方法用于创建可人工触发 change 事件的对象,但该方法在浏览器中已被废弃。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.getOwnPropertyDescriptor()",
|
||||
"trans": [
|
||||
"Object.getOwnPropertyDescriptor() 方法返回指定对象上一个自有属性对应的属性描述符。(自有属性指的是直接赋予该对象的属性,不需要从原型链上进行查找的属性)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.getOwnPropertyDescriptors()",
|
||||
"trans": [
|
||||
"Object.getOwnPropertyDescriptors() 方法用来获取一个对象的所有自身属性的描述符。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.getOwnPropertyNames()",
|
||||
"trans": [
|
||||
"Object.getOwnPropertyNames()方法返回一个由指定对象的所有自身属性的属性名(包括不可枚举属性但不包括Symbol值作为名称的属性)组成的数组。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.getOwnPropertySymbols()",
|
||||
"trans": [
|
||||
"Object.getOwnPropertySymbols() 方法返回一个给定对象自身的所有 Symbol 属性的数组。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.getPrototypeOf()",
|
||||
"trans": [
|
||||
"Object.getPrototypeOf() 方法返回指定对象的原型(内部[[Prototype]]属性的值)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.is()",
|
||||
"trans": [
|
||||
"Object.is()方法判断两个值是否是相同的值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.isExtensible()",
|
||||
"trans": [
|
||||
"Object.isExtensible() 方法判断一个对象是否是可扩展的(是否可以在它上面添加新的属性)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.isFrozen()",
|
||||
"trans": [
|
||||
"Object.isFrozen()方法判断一个对象是否被冻结。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.isSealed()",
|
||||
"trans": [
|
||||
"Object.isSealed() 方法判断一个对象是否被密封。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.keys()",
|
||||
"trans": [
|
||||
"Object.keys() 方法会返回一个由一个给定对象的自身可枚举属性组成的数组,数组中属性名的排列顺序和使用 for...in 循环遍历该对象时返回的顺序一致 。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.observe()",
|
||||
"trans": [
|
||||
"Object.observe() 方法用于异步地监视一个对象的修改。当对象属性被修改时,方法的回调函数会提供一个有序的修改流。然而,这个接口已经被废弃并从各浏览器中移除。你可以使用更通用的 Proxy 对象替代。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.preventExtensions()",
|
||||
"trans": [
|
||||
"Object.preventExtensions()方法让一个对象变的不可扩展,也就是永远不能再添加新的属性。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "eval()",
|
||||
"trans": [
|
||||
"Object.eval() 方法用于在对象的上下文中对 JavaScript 代码字符串求值,但该方法已被移除。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "hasOwnProperty()",
|
||||
"trans": [
|
||||
"hasOwnProperty() 方法会返回一个布尔值,指示对象自身属性中是否具有指定的属性"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "isPrototypeOf()",
|
||||
"trans": [
|
||||
"isPrototypeOf() 方法用于测试一个对象是否存在于另一个对象的原型链上。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "propertyIsEnumerable()",
|
||||
"trans": [
|
||||
"propertyIsEnumerable() 方法返回一个布尔值,表示指定的属性是否可枚举。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleString()",
|
||||
"trans": [
|
||||
"toLocaleString() 方法返回一个该对象的字符串表示。此方法被用于派生对象为了特定语言环境的目的(locale-specific purposes)而重载使用。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toSource()",
|
||||
"trans": [
|
||||
"toSource()方法返回一个表示对象源代码的字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toString()",
|
||||
"trans": [
|
||||
"toString() 方法返回一个表示该对象的字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "unwatch()",
|
||||
"trans": [
|
||||
"unwatch() 删除一个 watch() 设置的 watchpoint."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "valueOf()",
|
||||
"trans": [
|
||||
"valueOf() 方法返回指定对象的原始值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "watch()",
|
||||
"trans": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.seal()",
|
||||
"trans": [
|
||||
"The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.setPrototypeOf()",
|
||||
"trans": [
|
||||
"如果对象的[[Prototype]]被修改成不可扩展(通过 Object.isExtensible()查看),就会抛出 TypeError异常。如果prototype参数不是一个对象或者null(例如,数字,字符串,boolean,或者 undefined),则什么都不做。否则,该方法将obj的[[Prototype]]修改为新的值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.unobserve()",
|
||||
"trans": [
|
||||
"Object.unobserve() 是用来移除通过 Object.observe()设置的观察者的方法。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Object.values()",
|
||||
"trans": [
|
||||
"Object.values()方法返回一个给定对象自己的所有可枚举属性值的数组,值的顺序与使用for...in循环的顺序相同 ( 区别在于 for-in 循环枚举原型链中的属性 )。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "apply()",
|
||||
"trans": [
|
||||
"apply() 方法调用一个函数, 其具有一个指定的this值,以及作为一个数组(或类似数组的对象)提供的参数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bind()",
|
||||
"trans": [
|
||||
"bind()方法创建一个新的函数, 当被调用时,将其this关键字设置为提供的值,在调用新函数时,在任何提供之前提供一个给定的参数序列。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "call()",
|
||||
"trans": [
|
||||
"call() 方法调用一个函数, 其具有一个指定的this值和分别地提供的参数(参数的列表)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "isGenerator()",
|
||||
"trans": [
|
||||
"判断一个函数是否是一个生成器."
|
||||
]
|
||||
}
|
||||
]
|
||||
56
public/dicts/js-promise.json
Normal file
56
public/dicts/js-promise.json
Normal file
@@ -0,0 +1,56 @@
|
||||
[
|
||||
{
|
||||
"name": "Promise.all()",
|
||||
"trans": [
|
||||
"Promise.all(iterable) 方法返回一个 Promise 实例,此实例在 iterable 参数内所有的 promise 都“完成(resolved)”或参数中不包含 promise 时回调完成(resolve);如果参数中 promise 有一个失败(rejected),此实例回调失败(reject),失败原因的是第一个失败 promise 的结果。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.allSettled()",
|
||||
"trans": [
|
||||
"该Promise.allSettled()方法返回一个在所有给定的promise已被决议或被拒绝后决议的promise,并带有一个对象数组,每个对象表示对应的promise结果。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.any()",
|
||||
"trans": [
|
||||
"Promise.any() 接收一个Promise可迭代对象,只要其中的一个 promise 完成,就返回那个已经有完成值的 promise 。如果可迭代对象中没有一个 promise 完成(即所有的 promises 都失败/拒绝),就返回一个拒绝的 promise,返回值还有待商榷:无非是拒绝原因数组或AggregateError类型的实例,它是 Error 的一个子类,用于把单一的错误集合在一起。本质上,这个方法和Promise.all()是相反的。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.prototype.catch()",
|
||||
"trans": [
|
||||
"catch() 方法返回一个Promise,并且处理拒绝的情况。它的行为与调用Promise.prototype.then(undefined, onRejected) 相同。 (事实上, calling obj.catch(onRejected) 内部calls obj.then(undefined, onRejected))."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.prototype.finally()",
|
||||
"trans": [
|
||||
"返回一个设置了 finally 回调函数的Promise对象。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.prototype.then()",
|
||||
"trans": [
|
||||
"then() 方法返回一个 Promise。它最多需要有两个参数:Promise 的成功和失败情况的回调函数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.race()",
|
||||
"trans": [
|
||||
"Promise.race(iterable) 方法返回一个 promise,一旦迭代器中的某个promise解决或拒绝,返回的 promise就会解决或拒绝。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.reject()",
|
||||
"trans": [
|
||||
"Promise.reject()方法返回一个带有拒绝原因的Promise对象。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Promise.resolve()",
|
||||
"trans": [
|
||||
"Promise.resolve()方法返回一个以给定值解析后的Promise 对象。"
|
||||
]
|
||||
}
|
||||
]
|
||||
194
public/dicts/js-string.json
Normal file
194
public/dicts/js-string.json
Normal file
@@ -0,0 +1,194 @@
|
||||
[
|
||||
{
|
||||
"name": "String.fromCharCode()",
|
||||
"trans": [
|
||||
"静态 String.fromCharCode() 方法返回由指定的UTF-16代码单元序列创建的字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "String.fromCodePoint()",
|
||||
"trans": [
|
||||
"String.fromCodePoint() 静态方法返回使用指定的代码点序列创建的字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "charAt()",
|
||||
"trans": [
|
||||
"charAt() 方法从一个字符串中返回指定的字符。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "charCodeAt()",
|
||||
"trans": [
|
||||
"charCodeAt() 方法返回0到65535之间的整数,表示给定索引处的UTF-16代码单元 (在 Unicode 编码单元表示一个单一的 UTF-16 编码单元的情况下,UTF-16 编码单元匹配 Unicode 编码单元。但在——例如 Unicode 编码单元 > 0x10000 的这种——不能被一个 UTF-16 编码单元单独表示的情况下,只能匹配 Unicode 代理对的第一个编码单元) 。如果你想要整个代码点的值,使用 codePointAt()。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "codePointAt()",
|
||||
"trans": [
|
||||
"codePointAt() 方法返回 一个 Unicode 编码点值的非负整数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "concat()",
|
||||
"trans": [
|
||||
"concat() 方法将一个或多个字符串与原字符串连接合并,形成一个新的字符串并返回。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "endsWith()",
|
||||
"trans": [
|
||||
"endsWith()方法用来判断当前字符串是否是以另外一个给定的子字符串“结尾”的,根据判断结果返回 true 或 false。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "includes()",
|
||||
"trans": [
|
||||
"includes() 方法用于判断一个字符串是否包含在另一个字符串中,根据情况返回 true 或 false。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "indexOf()",
|
||||
"trans": [
|
||||
"indexOf() 方法返回调用它的 String 对象中第一次出现的指定值的索引,从 fromIndex 处进行搜索。如果未找到该值,则返回 -1。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "lastIndexOf()",
|
||||
"trans": [
|
||||
"lastIndexOf() 方法返回指定值在调用该方法的字符串中最后出现的位置,如果没找到则返回 -1。length为需要检索字符串的长度,默认值为str.length。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "localeCompare()",
|
||||
"trans": [
|
||||
"localeCompare() 方法返回一个数字来指示一个参考字符串是否在排序顺序前面或之后或与给定字符串相同。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "match()",
|
||||
"trans": [
|
||||
"match() 方法检索返回一个字符串匹配正则表达式的的结果。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "matchAll()",
|
||||
"trans": [
|
||||
"matchAll() 方法返回一个包含所有匹配正则表达式及分组捕获结果的迭代器。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "normalize()",
|
||||
"trans": [
|
||||
"normalize() 方法会按照指定的一种 Unicode 正规形式将当前字符串正规化."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "padEnd()",
|
||||
"trans": [
|
||||
"padEnd() 方法会用一个字符串填充当前字符串(如果需要的话则重复填充),返回填充后达到指定长度的字符串。从当前字符串的末尾(右侧)开始填充。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "padStart()",
|
||||
"trans": [
|
||||
"padStart() 方法用另一个字符串填充当前字符串(重复,如果需要的话),以便产生的字符串达到给定的长度。填充从当前字符串的开始(左侧)应用的。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "repeat()",
|
||||
"trans": [
|
||||
"repeat() 构造并返回一个新字符串,该字符串包含被连接在一起的指定数量的字符串的副本。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "replace()",
|
||||
"trans": [
|
||||
"replace() 方法返回一个由替换值(replacement)替换一些或所有匹配的模式(pattern)后的新字符串。模式可以是一个字符串或者一个正则表达式,替换值可以是一个字符串或者一个每次匹配都要调用的回调函数。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "search()",
|
||||
"trans": [
|
||||
"search() 方法执行正则表达式和 String 对象之间的一个搜索匹配。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "slice()",
|
||||
"trans": [
|
||||
"slice() 方法提取某个字符串的一部分,并返回一个新的字符串,且不会改动原字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "split()",
|
||||
"trans": [
|
||||
"split() 方法使用指定的分隔符字符串将一个String对象分割成字符串数组,以将字符串分隔为子字符串,以确定每个拆分的位置。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "startsWith()",
|
||||
"trans": [
|
||||
"startsWith() 方法用来判断当前字符串是否以另外一个给定的子字符串开头,并根据判断结果返回 true 或 false。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "substring()",
|
||||
"trans": [
|
||||
"substring() 方法返回一个字符串在开始索引到结束索引之间的一个子集, 或从开始索引直到字符串的末尾的一个子集。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleLowerCase()",
|
||||
"trans": [
|
||||
"toLocaleLowerCase()方法根据任何特定于语言环境的案例映射,返回调用字符串值转换为小写的值。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLocaleUpperCase()",
|
||||
"trans": [
|
||||
"toLocaleUpperCase() 使用本地化(locale-specific)的大小写映射规则将输入的字符串转化成大写形式并返回结果字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toLowerCase()",
|
||||
"trans": [
|
||||
"toLowerCase() 会将调用该方法的字符串值转为小写形式,并返回。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toString()",
|
||||
"trans": [
|
||||
"toString() 方法返回指定对象的字符串形式。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "toUpperCase()",
|
||||
"trans": [
|
||||
"toUpperCase() 将调用该方法的字符串值转换为大写形式,并返回。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "trim()",
|
||||
"trans": [
|
||||
"trim() 方法会从一个字符串的两端删除空白字符。在这个上下文中的空白字符是所有的空白字符 (space, tab, no-break space 等) 以及所有行终止符字符(如 LF,CR)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "trimRight()",
|
||||
"trans": [
|
||||
"trimRight() 方法从一个字符串的右端移除空白字符。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "trimLeft()",
|
||||
"trans": [
|
||||
"一个新字符串,表示从其开头(左端)剥离空格的调用字符串。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "String.raw()",
|
||||
"trans": [
|
||||
"String.raw() 是一个模板字符串的标签函数,它的作用类似于 Python 中的字符串前缀 r 和 C# 中的字符串前缀 @(还是有点区别的,详见隔壁 Chromium 那边的这个 issue),是用来获取一个模板字符串的原始字符串的,比如说,占位符(例如 ${foo})会被处理为它所代表的其他字符串,而转义字符(例如 \\n)不会。"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -26,6 +26,15 @@ const dicts: any = {
|
||||
level8: ['专八', './dicts/Level8.json'],
|
||||
sat: ['SAT', './dicts/SAT.json'],
|
||||
toefl: ['TOEFL', './dicts/TOEFL.json'],
|
||||
jsArray: ['js-array', './dicts/js-array.json'],
|
||||
jsDate: ['js-date', './dicts/js-date.json'],
|
||||
jsGlobal: ['js-global', './dicts/js-global.json'],
|
||||
jsMapSet: ['js-map-set', './dicts/js-map-set.json'],
|
||||
jsMath: ['js-math', './dicts/js-math.json'],
|
||||
jsNumber: ['js-number', './dicts/js-number.json'],
|
||||
jsObject: ['js-object', './dicts/js-object.json'],
|
||||
jsPromise: ['js-promise', './dicts/js-promise.json'],
|
||||
jsString: ['js-string', './dicts/js-string.json'],
|
||||
}
|
||||
|
||||
type WordType = {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const isLegal = (val: string): boolean => /^[a-z_A-Z'-]$/.test(val)
|
||||
export const isLegal = (val: string): boolean => /^[a-z_A-Z_._(_)_1-9'-]$/.test(val)
|
||||
|
||||
Reference in New Issue
Block a user