This appendix covers
- Best practices when writing JavaScript
- Using JSON effectively to pass data
- Uncovering callbacks and escaping callback hell
- Writing modular JavaScript with closures and patterns
JavaScript is such a fundamental part of the MEAN stack that we’re going to spend a little bit of time looking at it. We need to cover the bases because successful MEAN development depends on it. JavaScript is such a common language that it seems everybody knows some of it. This is partly because JavaScript is really easy to get started with, and seems quite forgiving with the way that it’s written. Unfortunately, this looseness and low barrier to entry can encourage bad habits and sometimes have some quite unexpected results.
The aim of this appendix isn’t to teach JavaScript from scratch; if you don’t know JavaScript at all you may struggle and find it hard going. On the other hand, not everybody will need to read this appendix in detail, particularly experienced JavaScript developers. If this is you, it’s probably worth your while skimming through it just in case there’s something new in here.