随笔分类 -  Javascript

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 31 下一页
摘要: 阅读全文
posted @ 2020-03-22 02:16 Zhentiw 阅读(149) 评论(0) 推荐(0)
摘要:Learn how to use custom events to expose internal events from withing a web component. class MyWelcome extends HTMLElement { constructor() { super(); 阅读全文
posted @ 2020-03-11 16:31 Zhentiw 阅读(171) 评论(0) 推荐(0)
摘要:What makes objects different is that we can create more of them. Every time we use the {} object literal, we create a brand new object value: let shre 阅读全文
posted @ 2020-02-25 18:46 Zhentiw 阅读(105) 评论(0) 推荐(0)
摘要:Let's see a simple code example: let pet = "dog" console.log(pet) We have console.log(pet) inside the code, when you read it, you might say: Pass ´pet 阅读全文
posted @ 2020-02-24 18:39 Zhentiw 阅读(142) 评论(0) 推荐(0)
摘要:It can be confusing to understand when and how the .prototype and .proto properties are created and used. They both seem to imply having something to 阅读全文
posted @ 2020-02-21 20:36 Zhentiw 阅读(205) 评论(0) 推荐(0)
摘要:"let" keyword, the same as "const" does hoist the variable. But different from 'var', it does both hoist and assign value as "undefined". "let" in oth 阅读全文
posted @ 2020-02-21 19:48 Zhentiw 阅读(114) 评论(0) 推荐(0)
摘要:The Promise.any() method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise object that is fulfilled with the v 阅读全文
posted @ 2020-02-20 19:01 Zhentiw 阅读(200) 评论(0) 推荐(0)
摘要:The Promise.allSettled() method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise object that is fulfilled wit 阅读全文
posted @ 2020-02-20 18:27 Zhentiw 阅读(458) 评论(0) 推荐(0)
摘要:In Javascript, there are two types of event loops for async tasks. First one, is well known one, for example, setTimeout, http request, click event wi 阅读全文
posted @ 2020-02-20 17:04 Zhentiw 阅读(132) 评论(0) 推荐(0)
摘要:Primitive Values Undefined (undefined), used for unintentionally missing values. Null (null), used for intentionally missing values. Booleans (true an 阅读全文
posted @ 2020-02-18 17:24 Zhentiw 阅读(230) 评论(0) 推荐(0)
摘要:Sometimes we need to prevent some properties on a JavaScript object from being iterated over and accessed in "for ... in" loops. In this lesson, we wi 阅读全文
posted @ 2020-02-16 22:14 Zhentiw 阅读(111) 评论(0) 推荐(0)
摘要:function looksLike(a, b) { return ( a && b && Object.keys(b).every(bKey => { const bVal = b[bKey] const aVal = a[bKey] if (typeof bVal 'function') { r 阅读全文
posted @ 2020-01-23 20:39 Zhentiw 阅读(176) 评论(0) 推荐(0)
摘要:There are several fundamental problems with trying to manage the state of a function through the use of booleans. The first is often referred to as "b 阅读全文
posted @ 2020-01-18 17:11 Zhentiw 阅读(369) 评论(0) 推荐(0)
摘要:Generators offer flexible alternatives to working with arrays and how you want to iterate through the data. While most scenarios are covered by the me 阅读全文
posted @ 2020-01-08 17:58 Zhentiw 阅读(143) 评论(0) 推荐(0)
摘要:Generator functions are great at generating data. You can create all types of functions that take params to define what sort of data to generate. The 阅读全文
posted @ 2020-01-08 17:01 Zhentiw 阅读(106) 评论(0) 推荐(0)
摘要:Since generators can take initial values and expose a next method which can run updates on the initial value, it becomes trivial to make a state machi 阅读全文
posted @ 2020-01-08 16:59 Zhentiw 阅读(133) 评论(0) 推荐(0)
摘要:Generators emulate the behavior of a closure where they wrap an initial value then can take subsequent values through next to yield something based on 阅读全文
posted @ 2020-01-08 16:47 Zhentiw 阅读(123) 评论(0) 推荐(0)
摘要:Generators allow you to hook together multiple generators with the yield* syntax. This allows you to branch off into many different types of iteration 阅读全文
posted @ 2020-01-08 16:30 Zhentiw 阅读(189) 评论(0) 推荐(0)
摘要:Generators allow you to use the yield * syntax to yield each iteration of nested iterable as part of the main iterations. This enables you to combine 阅读全文
posted @ 2019-12-29 13:45 Zhentiw 阅读(129) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-12-28 11:37 Zhentiw 阅读(128) 评论(0) 推荐(0)

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 31 下一页