随笔分类 -  Javascript

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 30 下一页
摘要:Values assigned with let and const are seen everywhere in JavaScript. It's become common to hear them explained like so: "const creates an constant (i 阅读全文
posted @ 2018-05-21 02:11 Zhentiw 阅读(136) 评论(0) 推荐(0)
摘要:function solution( tags = ['ul', 'ol']) { const [uls, ols] = tags.map(tag => Array.from($(`${tag}`))); const [logUl, logOl] = tags.map(tag => new Logg 阅读全文
posted @ 2018-05-17 05:02 Zhentiw 阅读(268) 评论(0) 推荐(0)
摘要:JavaScript provides primitive types and means of processing those. However, those are not enough. Real data must somehow come into the program and dat 阅读全文
posted @ 2018-05-15 21:59 Zhentiw 阅读(280) 评论(0) 推荐(0)
摘要:Functions are first class in JavaScript. This means we can treat a function like any other data. This also means we can end up with a function as the 阅读全文
posted @ 2018-05-14 21:02 Zhentiw 阅读(245) 评论(0) 推荐(0)
摘要:The alt method allows us to recover from a nothing with a default Maybe, but sometimes our recovery efforts might need to enlist some logic to recover 阅读全文
posted @ 2018-05-14 18:54 Zhentiw 阅读(374) 评论(0) 推荐(0)
摘要:Once we’re using Maybes throughout our code, it stands to reason that at some point we’ll get a Maybe and want to continue applying transformations. W 阅读全文
posted @ 2018-05-14 17:54 Zhentiw 阅读(383) 评论(0) 推荐(0)
摘要:Sometimes, we run into situations where we end up with a Maybe within the context of another Maybe. Nested structures like this can get really confusi 阅读全文
posted @ 2018-05-11 20:36 Zhentiw 阅读(522) 评论(0) 推荐(0)
摘要:In this lesson, we’ll look at the propPath utility function. We’ll ask for a property multiple levels deep in an object and get back a Maybe. We’ll ge 阅读全文
posted @ 2018-05-11 20:18 Zhentiw 阅读(218) 评论(0) 推荐(0)
摘要:In this lesson, we’ll use a Maybe to safely operate on properties of an object that could be undefined. We’ll use our initial code as the basis for a  阅读全文
posted @ 2018-05-11 19:34 Zhentiw 阅读(227) 评论(0) 推荐(0)
摘要:In this lesson, we’ll create a safe function that gives us a flexible way to create Maybes based on a value and a predicate function that we supply. W 阅读全文
posted @ 2018-05-11 19:04 Zhentiw 阅读(201) 评论(0) 推荐(0)
摘要:In this lesson, we’ll get started with the Maybe type. We’ll look at the underlying Just and Nothing types and create a simple utility function to cre 阅读全文
posted @ 2018-05-11 03:15 Zhentiw 阅读(207) 评论(0) 推荐(0)
摘要:When it comes to websites performance is king. How long it takes for a page to load can mean the difference of millions of dollars for large ecommerce 阅读全文
posted @ 2018-05-08 20:27 Zhentiw 阅读(326) 评论(0) 推荐(0)
摘要:// Asynchronous iteration --> Symbol.asyncIterator async function main() { const syncIterable = [ Promise.resolve('a'), Promise.resolve('b'), ]; for await (const x of sync... 阅读全文
posted @ 2018-02-25 01:47 Zhentiw 阅读(331) 评论(0) 推荐(0)
摘要:Hyperapp is an ultra lightweight (1kb), minimal, functional, JavaScript library for building UIs. It comes with a VDOM engine and state management wit 阅读全文
posted @ 2018-02-07 19:03 Zhentiw 阅读(244) 评论(0) 推荐(0)
摘要:Hyperapp is an ultra lightweight (1kb), minimal, functional, JavaScript library for building UIs. It comes with a VDOM engine and state management wit 阅读全文
posted @ 2018-02-07 16:56 Zhentiw 阅读(142) 评论(0) 推荐(0)
摘要:We can execute generators from generators, and delegate the iteration control with the yield* keyword. Yo dawg, I heard you like generators, so I put 阅读全文
posted @ 2018-02-06 21:01 Zhentiw 阅读(174) 评论(0) 推荐(0)
摘要:ES2017 added two new string functions. They are padStart and padEndfunctions. In this lesson, we will understand how to use these functions and a few 阅读全文
posted @ 2018-01-29 00:20 Zhentiw 阅读(352) 评论(0) 推荐(0)
摘要:In Javascript, all function arguments are optional by default. That means if you ever forget to pass a critical parameter, the code will just fail wit 阅读全文
posted @ 2018-01-22 17:35 Zhentiw 阅读(277) 评论(0) 推荐(0)
摘要:Transducers remove the requirement of being lazy to optimize for things like take(10). However, it can still be useful to "bind" a collection to a set 阅读全文
posted @ 2018-01-17 21:44 Zhentiw 阅读(219) 评论(0) 推荐(0)
摘要:A frequent use case when transducing is to apply a transformation to items without changing the type of the collection. In this lesson, we'll create a 阅读全文
posted @ 2018-01-17 20:52 Zhentiw 阅读(229) 评论(0) 推荐(0)

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 30 下一页