by ricardobeat · 14y ago · 0 comments
For debugging: get used to webkit inspector and Firebug. console.log is the best thing since sliced bread (object inspection, etc). Use a `debugger;` statement to insert breakpoints [3].
node.js: get started with Express [4] and mocha [5]. Make the jump to coffeescript after you're comfortable, it's a great fit on the server. Read howtonode's articles to get an introduction to various aspects of node [6].
[1] jshint.com
[2] https://github.com/mishoo/UglifyJS
[3] https://developer.mozilla.org/En/Debugging
https://github.com/johnbender/jshint-service
You can use the provided address in the post commit hook if you don't feel like setting up the server yourself.
[edit: post commit -> pre commit]
Oh also: python -mjson.tool is great for formatting json on the command line. Like: curl -XGET http://example.com/API | python -mjson.tool
For example, doing comparisons (x == null) or (x != null) is a well known shortcut for checking vs null or undefined. There's nothing inherently "bad" about using that shortcut.
(of course, there's really no reason to be using JSLint over JSHint anyway)
Keep in mind, this is simply an opinion. Although not everybody appreciates JSLint's emphasis on explicitness and readability, there are still a great number of people who do. To the OP, try both, and decide for yourself which one helps you write better code.