随笔分类 - Javascript
摘要: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
阅读全文
摘要:To write a simple Babel plugin, we can use http://astexplorer.net/ to help us. The plugin we want to write is: We want to trasnform the code which hig
阅读全文
摘要:In this lesson we will understand the For Of loop in Javascript which was introduced in ES6. The for-of loop lets you iterate of an itterable object (
阅读全文
摘要:Array: 1. slice() 2. concat 3. spread opreator: 4. Array.from: Object: Shadow copy: 1. object.assign: 2. spread opreator: Deep copy: From lodash: From
阅读全文
摘要:Great improvements and optimizations can be made to the output of bundled code. Prepack provides the ability to optimize code at build-time, producing
阅读全文
摘要:We look at the default Array.prototype.sort behavior and discuss how you can do case insensitive string sorting.
阅读全文