11 2023 档案

摘要:Ampt lets developers rapidly build, deploy, and scale JavaScript/TypeScript apps in the cloud without complicated configs or managing infrastructure. 阅读全文
posted @ 2023-11-24 02:04 Zhentiw 阅读(8) 评论(0) 推荐(0) 编辑
摘要:Refer to post: http://shebang.mintern.net/foolproof-html-escaping-in-javascript/ Code: var ESC_MAP = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '& 阅读全文
posted @ 2023-11-23 15:41 Zhentiw 阅读(10) 评论(0) 推荐(0) 编辑
摘要:package data // new type type distance float64 type distanceKm float64 // add ToKm method to distance type func (miles distance) ToKm() distanceKm { / 阅读全文
posted @ 2023-11-21 15:49 Zhentiw 阅读(8) 评论(0) 推荐(0) 编辑
摘要:const generateTimeMs = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min /** * A generator which can generate numbers based on settings 阅读全文
posted @ 2023-11-18 17:25 Zhentiw 阅读(8) 评论(0) 推荐(0) 编辑
摘要:In Go, function can return multi value: func addAndSubstract(a int, b int) (int, int) { return a+b, a-b } It is also possible to define named return v 阅读全文
posted @ 2023-11-16 15:28 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
摘要:What is holey array: an array with hole(s) const array = [1,2, ,3] Why this is a problem? Should array[2] to be undefined? Yes and no.. normally it is 阅读全文
posted @ 2023-11-13 15:58 Zhentiw 阅读(10) 评论(0) 推荐(0) 编辑
摘要:import { createBenchmark } from "./benchmark"; class MyArray extends Array {} const SIZE = 100; const obj: Record<string, number> = {}; /** * { * _0: 阅读全文
posted @ 2023-11-13 15:25 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
摘要:double equals is 15 times slower than triple equals. Underhood double equals need to call valueOf()function to convert the value. ({valueOf: () => 3}) 阅读全文
posted @ 2023-11-11 21:17 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要:Benchmark: 查看代码 import {createBenchmark} from './benchmark'; const ARRAY_SIZE = 10000; const array1 = []; // {value,prop_0}, {value,prop_0}, {value,pr 阅读全文
posted @ 2023-11-11 20:58 Zhentiw 阅读(20) 评论(0) 推荐(0) 编辑
摘要:https://www.npmjs.com/package/ses Lockdown The lockdown() function also tames some objects including regular expressions, locale methods, and errors. 阅读全文
posted @ 2023-11-08 03:31 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要:When you create a object, in V8, it creates a hidden class to repesent the object shape. Two different objects with same object shape might share the 阅读全文
posted @ 2023-11-08 02:50 Zhentiw 阅读(24) 评论(0) 推荐(0) 编辑
摘要:const COUNT = Number.parseInt(process.argv[2] || "10"); console.log(`Running ${COUNT} iterations.`); let value = 0; export function benchA() { value = 阅读全文
posted @ 2023-11-06 15:28 Zhentiw 阅读(14) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示