background preloader

Books & tutorials

Facebook Twitter

Free Resources - JavaScript.com. NodeSchool. Top 10 Mistakes Node.js Developers Make. Reveal.js - The HTML Presentation Framework. Node.js, Require and Exports. Back when I first started playing with node.js, there was one thing that always made me uncomfortable.

Node.js, Require and Exports

Embarrassingly, I'm talking about module.exports. I say embarrassingly because it's such a fundamental part of node.js and it's quite simple. In fact, looking back, I have no idea what my hang up was...I just remember being fuzzy on it. Assuming I'm not the only one who's had to take a second, and third, look at it before it finally started sinking in, I thought I could do a little write up. In Node, things are only visible to other things in the same file. Var x = 5; var addX = function(value) { return value + x; }; Another file cannot access the x variable or addX function. Now, before we look at how to expose things out of a module, let's look at loading a module.

Var misc = require('. Of course, as long as our module doesn't expose anything, the above isn't very useful. The Symmetry of JavaScript Functions. In JavaScript, functions are first-class entities. meaning, you can store them in data structures, pass them to other functions, and return them from functions.

The Symmetry of JavaScript Functions

An amazing number of very strong programming techniques arise as a consequence of functions-as-first-class-entities. One of the strongest is also one of the simplest: You can write functions that compose and transform other functions. a very, very, very basic introduction to decorators Let’s consider logical negation. We might have a function like this: const isaFruit = (f) => f === 'apple' || f === 'banana' || f === 'orange'; isaFruit('orange') //=> true We can use it to pick fruit from a basket, using an array’s .filter method: ['pecan', 'apple', 'chocolate', 'cracker', 'orange'].filter(isaFruit) //=> ["apple","orange"] What if we want the things-that-are-not-fruit?

Const notaFruit = (f) => f ! We could also take advantage of function expressions and inline the logical negation of isaFruit: Named function expressions demystified. Introduction Surprisingly, a topic of named function expressions doesn’t seem to be covered well enough on the web.

Named function expressions demystified

This is probably why there are so many misconceptions floating around. In this article, I’ll try to summarize both — theoretical and practical aspects of these wonderful Javascript constructs; the good, bad and ugly parts of them. In a nutshell, named function expressions are useful for one thing only — descriptive function names in debuggers and profilers. Well, there is also a possibility of using function names for recursion, but you will soon see that this is often impractical nowadays. I’ll start with a general explanation of what function expressions are how modern debuggers handle them. Read JavaScript Spessore. Prefaces Taking a page out of LiSP Teaching Lisp by implementing Lisp is a long-standing tradition.

Read JavaScript Spessore

If you set out to learn to program with Lisp, you will find book after book, lecture after lecture, and blog post after blog post, all explaining how to implement Lisp in Lisp. Christian Queinnec’s Lisp in Small Pieces is particularly notable, not just implementing a Lisp in Lisp, but covering a wide range of different semantics within Lisp. Lisp in Small Pieces’s approach is to introduce a feature of Lisp, then develop an implementation. Building interpreters (and eventually compilers) may seem esoteric compared to tutorials demonstrating how to build a blogging engine, but there’s a method to this madness.

Implementing a language feature teaches you a tremendous amount about how the feature works in a relatively short amount of time. J(oop)s In this book, we are going to implement saveral different kinds of object-oriented programming language semantics, in JavaScript. JavaScript Allongé. Customer Reviews: A Smarter Way to Learn JavaScript: The new approach that uses technology to cut your effort in half. Read 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.

Read JavaScript Allongé

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. “The second way is to pull an extra long double shot of Espresso. 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. JavaScript Éloquent : Une introduction moderne à la programmation. Single page apps in depth (new free book) You-Dont-Know-JS/README.md at master · getify/You-Dont-Know-JS.