上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 466 下一页
摘要: button.addEventListener( 'click', (event) => { console.log('listener 1') queueMicrotask(() => { console.log('microtask') }) } ) button.addEventListene 阅读全文
posted @ 2023-06-02 20:59 Zhentiw 阅读(9) 评论(0) 推荐(0) 编辑
摘要: You can use getEventListeners(button)directly inside chrome devtool, but not inside application code. You can use monitorEvents(button, 'keydown'), no 阅读全文
posted @ 2023-06-02 20:51 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
摘要: For example you have two containers running Container A: need to talk to Container B Container B, running a node application export port 1337 From con 阅读全文
posted @ 2023-05-31 20:00 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Three rules: There can only be one value owner There can be unlimited immutable borrows (reference) with no mutable references There can be only one m 阅读全文
posted @ 2023-05-29 14:42 Zhentiw 阅读(31) 评论(0) 推荐(0) 编辑
摘要: Difference between yieldand return returnset doneto true /** * Example 1 */ function* loggerator() { console.log("running"); yield "paused"; console.l 阅读全文
posted @ 2023-05-25 17:39 Zhentiw 阅读(2) 评论(0) 推荐(0) 编辑
摘要: On mobile device, when you open / close the keyboard, zoom in / out, it might affect the visual viewport view (the actual page content); to detect cha 阅读全文
posted @ 2023-05-24 17:53 Zhentiw 阅读(14) 评论(0) 推荐(0) 编辑
摘要: React set the ref to null in runtime. It is a limitation now for react. import { useRef } from 'react'; export const Component = () => { const ref = u 阅读全文
posted @ 2023-05-24 15:11 Zhentiw 阅读(14) 评论(0) 推荐(0) 编辑
摘要: `Option` and `Result` are two very central enums in Rust, and they are used for error handling and for representing the absence of a value. Here is a 阅读全文
posted @ 2023-05-24 13:57 Zhentiw 阅读(65) 评论(0) 推荐(0) 编辑
摘要: Typescript: import fs from "fs"; const fileName = process.argv[2]; if (fileName) { fs.readFileSync(fileName) .toString() .split("\n") .map((num) => pa 阅读全文
posted @ 2023-05-24 13:52 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要: Typescript: function practice(nums: number[], index: number): number { return (nums[index] ?? index) * 5 } In Rust: fn practice(nums: Vec<usize>, inde 阅读全文
posted @ 2023-05-24 01:24 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 466 下一页