随笔分类 - Javascript
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Our transduce function is powerful but requires a lot of boilerplate. It would be nice if we had a way to transduce into arrays and objects without ha
阅读全文
摘要:So far we've been transducing by manually calling .reduce() on arrays, but we want to be able to transduce over other collection types as well. In thi
阅读全文
摘要:To make our composition more readable and easier to name we are going to ceate a compose function we can use to avoid having to manually nest our tran
阅读全文
摘要:Immer is a tiny library that makes it possible to work with immutable data in JavaScript in a much more straight-forward way by operating on a tempora
阅读全文
摘要:A function's this argument is usually set implicitly, depending on how the function is called. Ordinary function calls, method calls, and constructor
阅读全文
摘要:In most cases, the value of a function's this argument is determined by how the function is called. This lesson explains what thisrefers to when we ca
阅读全文
摘要:In this lesson you will create a utility function that allows you to quickly compose behavior of multiple functions to create new behavior. By the end
阅读全文
摘要:Tf-idf, or term frequency-inverse document frequency, is a statistic that indicates how important a word is to the entire document. This lesson will e
阅读全文
摘要:In this lesson, we will learn how to train a Naive Bayes classifier and a Logistic Regression classifier - basic machine learning algorithms - on JSON
阅读全文
摘要:In this lesson, we will learn how to train a Naive Bayes classifier or a Logistic Regression classifier - basic machine learning algorithms - in order
阅读全文
摘要:We can use placeholder for more detail information: The placeholder can be found in data prop:
阅读全文
摘要:The code we want to trasform: transform to: Code:
阅读全文
摘要:The rule we want to write is show warning if user using console method: Rule: 'looksLike' & isPrimitive is pretty handy, you can save as until lib.
阅读全文
摘要:What we want to do is checking if user write nested if statements which actually can combine to one: Notice that if statement can write with block sta
阅读全文
摘要:We want to write a Babel Plugin, which move 'const versionRegex = /(/d+)\.(/d+)\.(/d+)/gi' out of function scope and put it into global scope. Code: A
阅读全文

浙公网安备 33010602011771号