随笔分类 -  Javascript

摘要:Learn how to query an Immutable.Map() using get, getIn, has, includes, find, first and last. These are powerful operators that make finding data in an... 阅读全文
posted @ 2015-10-18 19:42 Zhentiw
摘要:We will now look at five methods that modify an Immutable.Map().setupdatedeleteclearmerge//set()var map = Immutable.Map();var todo = { id: +new Date(... 阅读全文
posted @ 2015-10-18 18:16 Zhentiw
摘要:Learn how to create an Immutable.Map() through plain Javascript object construction and also via array tuples.console.clear();// Can be an objectvar m... 阅读全文
posted @ 2015-10-18 17:55 Zhentiw
摘要:Learn how Immutable.js data structures are different from native iterable Javascript data types and why they provide an excellent foundation on which ... 阅读全文
posted @ 2015-10-15 02:36 Zhentiw
摘要:The join() method joins all elements of an array into a string.var name = 'shane osbourne';var upper = name.split(' ') // [shane, osbourne].map(x => x... 阅读全文
posted @ 2015-10-09 01:04 Zhentiw
摘要:For example there are two array of object and you want to print out each element, it is bad if you use two forEach method on each array:var people1 = ... 阅读全文
posted @ 2015-10-09 00:37 Zhentiw
摘要:JSPM can handle installed packages, transpiling ES6, and bundling all from the command-line. This video gives a quick overview of install JSPM, instal... 阅读全文
posted @ 2015-09-27 22:36 Zhentiw
摘要:Let's take a closer look at using Javascript's built in Array reduce function. Reduce is deceptively simple and when harnessed correctly can achieve v... 阅读全文
posted @ 2015-09-02 14:51 Zhentiw
摘要:ESLint is a JavaScript linter (static analysis tool) that offers full support for ES6, JSX, and other modern tools via plugins. We walk through settin... 阅读全文
posted @ 2015-08-28 03:57 Zhentiw
摘要:The very first thing to understand when we're talking about this-keyword is really understand what's the purpose of the this-keyword is, or why we eve 阅读全文
posted @ 2015-08-20 02:15 Zhentiw 阅读(431) 评论(0) 推荐(0)
摘要:Really the trick to flattening deeply nested structures is to just keep nesting map expressions until you have a variable or function argument, when i... 阅读全文
posted @ 2015-08-12 16:46 Zhentiw
摘要:Refactoring is a great opportunity to learn and we have an existing Javascript function that islengthy, hard to understand, and overcomplicated. We'll... 阅读全文
posted @ 2015-08-12 03:13 Zhentiw
摘要:Variable Hoisting// Variable Hoistingvar myVariable = 'Outer Value';var fn = function(){ alert(myVariable); var myVariable = 'New Local Value';};fn(... 阅读全文
posted @ 2015-08-01 22:01 Zhentiw
摘要:Armed with themapandconcatAllfunctions, we can create fairly complex interactions in a simple way. We will use Observable to create a simple drag and ... 阅读全文
posted @ 2015-06-30 21:37 Zhentiw
摘要:Like an array, Observable has a map method that allows us to transform a sequence into a new Observable.var Observable = Rx.Observable;//Create click ... 阅读全文
posted @ 2015-06-25 04:55 Zhentiw
摘要:In this lesson we will get introduced to theObservabletype. An Observable is acollection that arrives over time. Observables can be used to model even... 阅读全文
posted @ 2015-06-24 15:44 Zhentiw
摘要:Javascript modules are a design pattern that allow you to encapsulate your code into smaller self managing pieces. They help you separate your code, p... 阅读全文
posted @ 2015-06-24 15:01 Zhentiw
摘要:This lesson shows how to refactor your old loops into using a simpler and more powerful lodash-style. We will start by looking at how many people trad... 阅读全文
posted @ 2015-03-21 22:31 Zhentiw
摘要:In addition to flat Arrays, programmers must often deal with nested Arrays. For example let's say we have an Array of stock exchanges, each of which i 阅读全文
posted @ 2015-03-21 22:23 Zhentiw