随笔分类 - Javascript
摘要:Understanding Immutable.js's Map() and List() structures will likely take you as far as you want to go with immutable programming. They have only smal
阅读全文
posted @ 2016-02-22 15:47
Zhentiw
摘要:Immutable.js provides several conversion methods to migrate one structure to another. Each Immutable.js class contains a prefixed "to" method like Map
阅读全文
posted @ 2016-02-22 04:22
Zhentiw
摘要:Immutable.js iterables offer the reduce() method, a powerful and often misunderstood functional operator on which map(), filter(), groupBy(), etc. are
阅读全文
posted @ 2016-02-22 03:35
Zhentiw
摘要:The Immutable.js Map() is analogous to a Javascript Object or Hash since it is comprised of key-value pairs. The Immutable.js List() is analogous to a
阅读全文
posted @ 2016-02-21 23:37
Zhentiw
摘要:Immutable.js offers the fromJS() method to build immutable structures from objects and array. Objects are converted into maps. Arrays are converted in
阅读全文
posted @ 2016-02-21 22:53
Zhentiw
摘要:const stores = Immutable.List([ { name: 'Store42', position: { latitude: 61.45, longitude: 23.11, }, address: 'whatever' }, { name: 'Store2', position
阅读全文
posted @ 2016-02-19 20:25
Zhentiw
摘要:We can use: ^: match the beginning $: match the end Let's say we have the string like the following: var str = `12/1/16 12-16-13 11/12/16 12-12-2016`;
阅读全文
posted @ 2016-02-17 20:27
Zhentiw
摘要:Regular Expression Backreferences provide us a method to match a previously captured pattern a second time. For example we have an string, and we want
阅读全文
posted @ 2016-02-16 02:19
Zhentiw
摘要:Regular Expression Word Boundaries allow to perform "whole word only" searches within our source string. Imaging we have string as follow, and we want
阅读全文
posted @ 2016-02-16 02:00
Zhentiw
摘要:Let's image tow cases for the following string: var str = `foo foobar foobaz fooboo` First of all: we know how to capture foobar or fooboo: var regex
阅读全文
posted @ 2016-02-15 02:12
Zhentiw
摘要:We'll capture groups of characters we wish to match, use quantifiers with those groups, and use references to those groups in String.prototype.replace
阅读全文
posted @ 2016-02-15 02:00
Zhentiw
摘要:In this lesson we'll learn shorthands for common character classes as well as their negated forms. var str = `Afewserg, %8392 ?AWE`; var regex = /[a-z
阅读全文
posted @ 2016-02-01 03:22
Zhentiw
摘要:Regular Expression Character Classes define a group of characters we can use in conjunction with quantifiers. var str = `cat bat mat Hat 0at ?at`; var
阅读全文
posted @ 2016-02-01 03:14
Zhentiw
摘要:Regular Expression Quantifiers allow us to identify a repeating sequence of characters of minimum and maximum lengths. In this lesson we'll use Regula
阅读全文
posted @ 2016-02-01 03:07
Zhentiw
摘要:The simplest use of Regular Expressions is to find a plain text pattern. In this lesson we'll look at at finding plain text patterns as well as using
阅读全文
posted @ 2016-02-01 02:48
Zhentiw
摘要:Three methods to preform redirection in browser: widnow.location.href window.location.assign window.location.replace 1 & 2, they are pretty much the s
阅读全文
posted @ 2016-01-31 17:51
Zhentiw
摘要:var str = "Is this This?"; //var regex = new RegExp("is", "gi"); var regex = /is/gi; //console.log(regex.test(str)); console.log(regex.exec(str)); //[
阅读全文
posted @ 2016-01-29 05:15
Zhentiw
摘要:Local Storage is a native JavaScript Web API that makes it easy to store and persist data (as key-value pairs) in the Browser. In this lesson, we'll w
阅读全文
posted @ 2016-01-27 21:44
Zhentiw
摘要:JSON (JavaScript Object Notation) is a standard method to serialize JavaScript objects and is commonly used to transfer data from the server to the br
阅读全文
posted @ 2016-01-27 20:31
Zhentiw
摘要:Javascript with Chorme v8 engine works like this :For Chorme engine, v8, it has call stack.And all the async opreations functions are stay in webapis....
阅读全文
posted @ 2016-01-26 21:12
Zhentiw