Angus Croll

javascriptweblog.wordpress.com · Personal blog · on HN since 2010

Angus Croll writes about JavaScript patterns and language details, including mixins, the comma operator, and typeof.

What HN saysOne HN commenter calls it hands down their favorite JavaScript blog, though it notes updates have become rare.
64HN people shared it
12linked it in comments
85stories submitted
1.1Kstory points
1 year agolast shared
2010people per year2026

Most-shared posts

  1. 1
    JavaScript Mixins for grown-ups
    7 people · 66 points · first shared 2011 · 7 comments on HN
  2. 2
    If Hemingway Wrote JavaScript: Explained
    6 people · 8 points · first shared 2015 · discussion on HN
  3. 3
    The JavaScript Comma Operator
    5 people · 73 points · first shared 2011 · 19 comments on HN
  4. 4
    A new JavaScript pattern that saved my project
    5 people · 25 points · first shared 2010 · 1 comments on HN
  5. 5
    Fixing the JavaScript typeof operator
    5 people · 7 points · first shared 2011 · discussion on HN
  6. 6
    JavaScript, JavaScript
    5 people · 5 points · first shared 2010 · discussion on HN
  7. 7
    JavaScript Prototypes Made Easy
    4 people · 150 points · first shared 2010 · 33 comments on HN
  8. 8
    Function Declarations vs. Function Expressions
    4 people · 13 points · first shared 2010 · 1 comments on HN
  9. 9
    Truth, Equality and JavaScript
    3 people · 18 points · first shared 2011 · discussion on HN
  10. 10
    JavaScript Fat City (new function syntax)
    3 people · 15 points · first shared 2012 · 1 comments on HN
  11. 11
    Understanding JavaScript Closures
    3 people · 9 points · first shared 2010 · discussion on HN
  12. 12
    JSON and JSONP
    3 people · 6 points · first shared 2010 · discussion on HN
  13. 13
    Does your browser run JavaScript strict mode?
    3 people · 6 points · first shared 2011 · discussion on HN
  14. 14
    Finally someone makes sense of JavaScript's this keyword
    2 people · 241 points · first shared 2010 · 52 comments on HN
  15. 15

What HN people wrote when they linked it

malandrew · 2012-02-04
The only other video that sticks out in mine head is this Google Tech Talk by Nicholas Zakas about javascript performance. http://www.youtube.com/watch?v=mHtdZgou0qU Besides videos, check out Javascript Garden: http://bonsaiden.github.com/JavaScript-Garden/ Javascript Weblog: http://javascriptweblog.wordpress.com/ Here are some links over on Quora: http://www.quora.com/What-are-the-best-resources-for-learning-JavaScri… The three books worth getting for someone who is already a programmer are: Crockford's "Javascript: The Good Parts", Stoyan Stefanov's "Javascript Patterns", and Resigs's "Secrets of the Javascript Ninja" IMHO, there are few videos worthwhile.
nxn · 2011-10-17
http://javascriptweblog.wordpress.com/ Updates have gotten sort of rare lately, but it is hands down my favorite JS blog.
MarsAscendant · 2019-01-07
Interesting. I stopped touching frameworks on my second year in. It's the same problem I have with trying to develop within the constraints of someone else's work: I find it confusing and anxiety-inducing. I'd rather write my own stuff, unless I'm woefully unequipped to to begin with. (Cryptography, authentification, credit card handling...) I feel like I'd learned quite a bit of JavaScript, specifically – especially with the help of someone like Angus Croll [https://javascriptweblog.wordpress.com/]. I'm not that clever a JS developer – or a programmer, for that matter – so his `compose()` and `curry()` sound magical to me.
hkuo · 2013-03-26
I learned this method with the book JavaScript the Good Parts, though it was a while ago and I can't remember the specific reasoning behind the books' recommendation. From the other commenter's SO link, I found this link to go more in depth into the differences of declaring functions, and it seems to come down to having stricter control on the order of events with no surprises. http://javascriptweblog.wordpress.com/2010/07/06/function-declarations… And here's an example of one of the surprises you'll run into if you don't declare your functions in this way: http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html
angusC · 2010-10-12
Mine is up and running - thanks! http://javascriptweblog.wordpress.com
nsonha · 2021-10-12
https://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascrip… tl;dr: Object.prototype.toString.call, you most likely to also want to exclude null, RegExp, Function, Date, Number, Boolean & String (not string)
ranko · 2016-03-14
"If Hemingway Wrote Javascript" (https://www.nostarch.com/hemingway, see also https://javascriptweblog.wordpress.com/2015/01/05/if-hemingway-wrote-j… in which five short programs are each written in five different styles (all in Javascript). It shows how different programming styles can be used in the same language to solve the same problem. It's unlikely that you'll start writing in the style of Borges or Austen after reading this, but it is entertaining and amusing.
bjterry · 2013-08-21
I don't understand your contradiction to the parent poster. All JavaScript functions are closures, including anonymous functions that don't reference any lexically-scoped variables, and even named functions at the top level, which close over the global environment[1]. Also, callback functions don't have to be anonymous functions, you can just as easily pass named functions. 1: http://javascriptweblog.wordpress.com/2010/10/25/understanding-javascr…
epidemian · 2013-07-01
Yep, it seems it was added on Firefox 22: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/arro… It also seems it's the proposal for ES6: http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax. This blog post explains the differences between these functions and current functions: http://javascriptweblog.wordpress.com/2012/04/09/javascript-fat-city/; i wish the unbound "->" alternative is included, so that functions used as methods can also use the new syntax.
firefoxman1 · 2012-06-22
I often use the improved typeof function: http://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript… Question: why is the way to determine null considered "very bad"? It works and seems like a valid way, since both empty objects and arrays are truthy, null is the only falsy "object" type.
karterk · 2012-02-17
There is a better way to do the mixins in JS. See this awesome post by Angus Croll: http://javascriptweblog.wordpress.com/2011/05/31/a-fresh-look-at-javas… `this` in JS generally incurs a lot of wrath, but this is one cool hack with `this`.
jonahx · 2013-03-26
I don't believe so. It sounds like he prefers using function declations to function expressions. And this is incorrect according to most js gurus. For example: http://javascriptweblog.wordpress.com/2010/07/06/function-declarations… From that link: "b) Function Expressions are more versatile. A Function Declaration can only exist as a “statement” in isolation. All it can do is create an object variable parented by its current scope. In contrast a Function Expression (by definition) is part of a larger construct. If you want to create an anonymous function or assign a function to a prototype or as a property of some other object you need a Function Expression. Whenever you create a new function using a high order application such as curry or compose you are using a Function Expression. Function Expressions and Functional Programming are inseparable." Also this link: http://kangax.github.com/nfe/ brings up these disadvantages to function declarations: * can't conditionally declare functions with consistent results across browsers * function declarations cannot appear in blocks (technically), though many implementations allow this in practice finally, i'd argue that function expressions encourage you to think of functions as the first class objects js intended them to be

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close