随笔分类 -  Javascript

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 30 下一页
只有注册用户登录后才能阅读该文。
posted @ 2019-12-11 02:29 Zhentiw 阅读(2) 评论(0) 推荐(0)
摘要:When the ES6 class shipped back in 2015, a number of additional keywords came with it. Two of these are constructor and super. Both of these are speci 阅读全文
posted @ 2019-12-07 23:09 Zhentiw 阅读(130) 评论(0) 推荐(0)
摘要:Classes are syntactic sugar over functions and functions are also referred to as "callable" objects. So it is possible to treat a function like an obj 阅读全文
posted @ 2019-12-07 23:04 Zhentiw 阅读(114) 评论(0) 推荐(0)
摘要:An IIFE (immediately invoked function expression) is when a function is called immediately after it is defined. These functions are defined and called 阅读全文
posted @ 2019-12-07 22:49 Zhentiw 阅读(109) 评论(0) 推荐(0)
摘要:For example, we have a 2D arrays; We want to sort by the number first, if the number are the same, then we want to sort by name DESC: So the result sh 阅读全文
posted @ 2019-12-01 22:46 Zhentiw 阅读(127) 评论(0) 推荐(0)
摘要:function addTo80(n ) { return 80 + n; } function memoizedAddTo80 (fn) { let cache = {}; return (n) => { /*keyword 'in' to check prop exists*/ if (n in cache) { console.log('from cache') return cache[n 阅读全文
posted @ 2019-12-01 17:35 Zhentiw 阅读(112) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2019-11-26 04:15 Zhentiw 阅读(2) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2019-11-26 03:26 Zhentiw 阅读(2) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2019-11-14 04:19 Zhentiw 阅读(3) 评论(0) 推荐(0)
摘要:const isPromise = obj => Boolean(obj) && typeof obj.then 'function'; This can be a tool save into your toolbox. 阅读全文
posted @ 2019-11-13 21:40 Zhentiw 阅读(333) 评论(0) 推荐(0)
摘要:JavaScript is single-threaded, which can present some problems when creating an interactive user experience. If JavaScript runs too long while a user 阅读全文
posted @ 2019-11-13 21:01 Zhentiw 阅读(163) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2019-11-13 04:19 Zhentiw 阅读(1) 评论(0) 推荐(0)
摘要:window.matchMedia() allow to listen to browser window size changes and trigger the callback for different media query size. you can attach a listener 阅读全文
posted @ 2019-11-05 17:10 Zhentiw 阅读(328) 评论(0) 推荐(0)
摘要:For example we have a 'useState' function, which takes a state and a function to update the state: const useState = (state, setState) => { const newSt 阅读全文
posted @ 2019-10-16 20:40 Zhentiw 阅读(140) 评论(0) 推荐(0)
摘要:regexr is a powerful tool for debugging existing regexes and creating new ones. In this lesson, we'll use the app to create a regex that matches Twitt 阅读全文
posted @ 2019-09-27 14:56 Zhentiw 阅读(220) 评论(0) 推荐(0)
摘要:This can be handy if you have a rate limit on API requests or if you need to pass the result of each promise to the next one. function fetchMessages(u 阅读全文
posted @ 2019-09-03 13:06 Zhentiw 阅读(118) 评论(0) 推荐(0)
摘要:Most developers are familiar with using img tags and assigning the src inside of HTML. It is also possible to only use JavaScript to fetch the image f 阅读全文
posted @ 2019-08-07 15:51 Zhentiw 阅读(267) 评论(0) 推荐(0)
摘要:For example we have a 'forEach' method which can loop though a linked list: Test: What if we want to use for...of loop? Then we need to convert Linked 阅读全文
posted @ 2019-08-06 13:36 Zhentiw 阅读(131) 评论(0) 推荐(0)
摘要:ES2019 introduces the Symbol.prototype.description property. In this lesson, we'll learn why this property is useful and unlocks Symbols as appropriat 阅读全文
posted @ 2019-07-24 14:35 Zhentiw 阅读(159) 评论(0) 推荐(0)
摘要:ES2019 introduces the Array.prototype.flatMap method. In this lesson, we'll investigate a common use case for mapping and filtering an array in a sing 阅读全文
posted @ 2019-07-24 14:30 Zhentiw 阅读(331) 评论(0) 推荐(0)

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 30 下一页