diff --git a/chapters/ajax/ajax_request_without_jquery.md b/chapters/ajax/ajax_request_without_jquery.md index 917cdfa..8dd9530 100644 --- a/chapters/ajax/ajax_request_without_jquery.md +++ b/chapters/ajax/ajax_request_without_jquery.md @@ -23,7 +23,7 @@ Let's set up a simple test HTML page with a button.

XMLHttpRequest Tester

- + @@ -53,7 +53,7 @@ loadDataFromServer = -> console.log 'data message: ', data.message else console.log 'Error loading data...' - + req.open 'GET', 'data.json', false req.send() @@ -63,7 +63,7 @@ loadDataButton.addEventListener 'click', loadDataFromServer, false ## Discussion -In the above code we essentially grab a handle to the button in our HTML (line 16) and add a *click* event listener (line 17). In our event listener, we define our callback function as loadDataFromServer. +In the above code we grab a handle to the button in our HTML (line 16) and add a *click* event listener (line 17). In our event listener, we define our callback function as loadDataFromServer. We define our loadDataFromServer callback beginning on line 2. @@ -77,7 +77,7 @@ The last thing we need to do is actually make our request. Line 13 opens a 'GET' request to retrieve the data.json file. -Line 14 sends our request to the server. +Line 14 sends our request to the server. ## Older Browser Support @@ -100,4 +100,3 @@ if (typeof @XMLHttpRequest == "undefined") {% endhighlight %} This code ensures the XMLHttpRequest object is available in the global namespace. - diff --git a/chapters/arrays/define-ranges.md b/chapters/arrays/define-ranges.md index 8296e09..a75a3f4 100644 --- a/chapters/arrays/define-ranges.md +++ b/chapters/arrays/define-ranges.md @@ -13,6 +13,7 @@ There are two ways to define a range of array elements in CoffeeScript. {% highlight coffeescript %} +# inclusive myArray = [1..10] # => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] @@ -20,6 +21,7 @@ myArray = [1..10] {% highlight coffeescript %} +# exclusive myArray = [1...10] # => [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] @@ -42,6 +44,7 @@ myLargeArray = [10...1] ## Discussion -Inclusive range always define by '..' operator. +Inclusive ranges are defined by the '..' operator and include the last value. + +Exclusive ranges are defined by '...', and always omit the last value. -Exclusive range define by '...', and always omit the last value.