Space after a comma but not before:
# Yes api_app.factory "ApiService", ($http) -> # No api_app.factory "ApiService" ,($http) ->
Write constants in all caps, LIKE_THIS
.
if
/else
, not unless
/else
.Use list comprehensions when they fit on a single line:
# Yes result = (item.name for item in array) # No results = [] for item in array results.push item.name
Use comprehensions for filtering when they fit on a single line:
result = (item for item in array when item.name is "test")
Use @property
not this.property
.