Skip to content

Commit 2324b03

Browse files
author
Julien
committed
Bring CoffeeScript idiom to conditional statement.
An advantage of CoffeeScript compared to JavaScript is its ability to check for array membership with the `in` keyword. A feature it borrowed from Python.
1 parent 6362596 commit 2324b03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapters/ajax/ajax_request_without_jquery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ loadDataFromServer = ->
4747

4848
req.addEventListener 'readystatechange', ->
4949
if req.readyState is 4 # ReadyState Compelte
50-
if req.status is 200 or req.status is 304 # Success result codes
50+
if req.status in [200, 304] # Success result codes
5151
data = eval '(' + req.responseText + ')'
5252
console.log 'data message: ', data.message
5353
else

0 commit comments

Comments
 (0)