2017年10月18日 星期三

Functional Programming in Javascript

This is a series of interactive exercises for learning Microsoft's Reactive Extensions (Rx) Library for Javascript. So why is the title "Functional Programming in Javascript"? Well it turns out that the key to learning Rx is training yourself to use functional programming to manipulate collections. Functional programming provides developers with the tools to abstract common collection operations into reusable, composable building blocks. You'll be surprised to learn that most of the operations you perform on collections can be accomplished with five simple functions:
  1. map
  2. filter
  3. mergeAll
  4. reduce
  5. zip
Here's my promise to you: if you learn these 5 functions your code will become shorter, more self-descriptive, and more durable. Also, for reasons that might not be obvious right now, you'll learn that these five functions hold the key to simplifying asynchronous programming. Once you've finished this tutorial you'll also have all the tools you need to easily avoid race conditions, propagate and handle asynchronous errors, and sequence events and AJAX requests. In short, these 5 functions will probably be the most powerful, flexible, and useful functions you'll ever learn.

from : https://github.com/ReactiveX/learnrx

2017年10月1日 星期日

How to get html elements with multiple css classes

The expression you're looking for is:
//div[contains(@class, 'class1') and contains(@class, 'class2')]
I highly suggest XPath visualizer, which can help you debug xpath expressions easily. It can be found here:

from : https://stackoverflow.com/questions/3881044/how-to-get-html-elements-with-multiple-css-classes

wibiya widget