background preloader

JavaScript Allongé

JavaScript Allongé
A Pull of the Lever: Prefaces “Café Allongé, also called Espresso Lungo, is a drink midway between an Espresso and Americano in strength. There are two different ways to make it. The first, and the one I prefer, is to add a small amount of hot water to a double or quadruple Espresso Ristretto. Like adding a splash of water to whiskey, the small dilution releases more of the complex flavours in the mouth. Foreword by Michael Fogus As a life-long bibliophile and long-time follower of Reg’s online work, I was excited when he started writing books. The act of writing is an iterative process with (very often) tight revision loops. In the case of JavaScript Allongé, you’ll find the Leanpub model a shining example of effectiveness. As a staunch advocate of functional programming, much of what Reg has written rings true to me. Enjoy. – Fogus, fogus.me Foreword by Matthew Knox A different kind of language requires a different kind of book. –Matthew Knox, mattknox.com Why JavaScript Allongé? Instead of:

JavaScript Enlightenment | by Cody Lindley | 1st Edition | ECMA-262, Edition 3 JavaScript Garden Although JavaScript deals fine with the syntax of two matching curly braces for blocks, it does not support block scope; hence, all that is left in the language is function scope. function test() { // a scope for(var i = 0; i < 10; i++) { // not a scope // count } console.log(i); // 10} There are also no distinct namespaces in JavaScript, which means that everything gets defined in one globally shared namespace. Each time a variable is referenced, JavaScript will traverse upwards through all the scopes until it finds it. In the case that it reaches the global scope and still has not found the requested name, it will raise a ReferenceError. The Bane of Global Variables // script Afoo = '42'; // script Bvar foo = '42' The above two scripts do not have the same effect. Again, that is not at all the same effect: not using var can have major implications. // global scopevar foo = 42;function test() { // local scope foo = 21;}test();foo; // 21 Local Variables var foo = 3; bar = 4;}test(10); Hoisting

JavaScript Succinctly JavaScript Succinctly was written to give readers an accurate, concise examination of JavaScript objects and their supporting nuances, such as complex values, primitive values, scope, inheritance, the head object, and more. If you’re an intermediate JavaScript developer and want to solidify your understanding of the language, or if you’ve only used JavaScript beneath the mantle of libraries such as jQuery or Prototype, this is the book for you. Author Cody Lindley talks about his latest book in Syncfusion's Succinctly series, JavaScript Succinctly. Given his many years of expertise and the overwhelming success of this last publication—jQuery Succinctly—what Cody says about JavaScript is something all experienced frontend developers should take to heart.

Book of Modern Front-end Tooling JS The Right Way Learn how to code by playing a game Learning JavaScript Design Patterns I would like to thank Rebecca Murphey for inspiring me to open-source this mini-book and release it for free download and distribution - making knowledge both open and easily available is something we should all strive for where possible. I would also like to extend my thanks to the very talented Alex Sexton who was kind enough to be the technical reviewer for this publication. I hope that it helps you learn more about design patterns and the usefulness of their application to JavaScript. Volume 2 of Essential JavaScript Design Patterns is currently being written and will be more detailed than this first edition. The ETA for it's online release is late Q4, 2011. For more detailed coverage of specific patterns, you may be interested in my posts on the Pub/Sub (Observer) or Decorator patterns. At the beginning of this book I will be focusing on a discussion about the importance and history of design patterns in any programming language. Patterns are not an exact solution.

Related: