随笔分类 - Javascript
摘要:Get more mileage from your console output by going beyond mere string logging - log entire introspectable objects, log multiple items in one call, and
阅读全文
摘要:Go beyond console.log by learning about log levels, filtering log output and structuring your output to be meaningful and concise. The JavaScript cons
阅读全文
摘要:Because semantic-release requires a specific message format, it's easier to follow this convention using a tool called commitizen. In this lesson, we'
阅读全文
摘要:There are so many repeated steps when releasing a new version of a library. The tool semantic-release automates this process by pushing off the respon
阅读全文
摘要:Somehow it looks like reflect in Java. For example: We define an mothod on the Object, it called defineMethod(). It accepts two arguements, one is met
阅读全文
摘要:In this lesson, we're going to use webpack to create a UMD (Universal Module Definition) build of our module so users can consume it in a browser. Ins
阅读全文
摘要:Something like 'for' or 'while', 'if', they don't create a new scope: Everyting written in for loop can be accessed outside the for loop. So, the prob
阅读全文
摘要:if-statements can add serious complexity and beg for refactoring. You can use polymorphic functions to simplify your ifs and dynamically call the appr
阅读全文
摘要:Array push is used to add elements to the end of an Array. In this lesson we'll see how the push method accepts multiple arguments, can be used to mer
阅读全文
摘要:Link: https://lodash.com/docs#memoize Example: It is useful when you want to find something like userId, then you can use memoize() to cache the resul
阅读全文
posted @ 2016-03-16 15:15
Zhentiw
摘要:var vehicle3 = { type: "Submarine", capacity: 8, storedAt: "Underwater Outpost", ranger1: { name: "Gregg Pollack", skillz: "Lasering", dayOff: "Friday
阅读全文
posted @ 2016-03-06 18:31
Zhentiw
摘要:/** Let inheritance help with memory efficiency */ function SignalFire(ID, startingLogs){ this.fireID = ID; this.logsLeft = startingLogs; } SignalFire
阅读全文
posted @ 2016-03-06 18:25
Zhentiw
摘要:Create package.json file Pubish to github and tag it Publish to npm Release a new version Publishing a beta version Mocha, chai testing: semantic-rele
阅读全文
posted @ 2016-03-06 18:17
Zhentiw
摘要:Using a character set repeated 1 or more times, make a pattern to search for strings that do not contain the characters 'a', 'e', 'i', 'o', 'u', and '
阅读全文
posted @ 2016-03-05 21:56
Zhentiw
摘要:String to check: As it turns out, our potential shipmates are extremely superstitious. As such, we do not want anyone to enter certain words in their
阅读全文
posted @ 2016-03-05 21:42
Zhentiw
摘要:/^-?\d{1,3}\.\d+$/gm
阅读全文
posted @ 2016-03-05 17:54
Zhentiw
摘要:Immutable.js offers methods to break immutable structures into subsets much like Array--for instance it has the all powerful slice()--and unlike Array
阅读全文
posted @ 2016-03-01 03:25
Zhentiw
摘要:Immutable.js provides several methods to iterate over an Immutable.Map(). These also apply to the other immutable structures found within the Immutabl
阅读全文
posted @ 2016-03-01 03:16
Zhentiw
摘要:The Immutable.js Record() allows you to model your immutable data much like you would model data with native Javascript classes or objects. It differs
阅读全文
摘要:While Immutable.js offers .is() to confirm value equality between iterables it comes at the cost of referencing each key and value in both objects. Fo
阅读全文
posted @ 2016-02-26 02:43
Zhentiw