background preloader

Javascript

Facebook Twitter

Questionnaire

Outils. Articles. Librairies. 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.

Node.js. 6 Free E-Books and Tutorials for Learning and Mastering Node.js. OK, we won't bore you by telling you what Node.js is again or why it's so dang hot. You want to learn Node.js? There's no completely finished Node.js book out there that we're aware of. But there's one complete book in rough draft form, two partial guides and several other great resources for learning Node.js. No more excuses: Try Node.js for $0.02 or less in just a few minutes No more excuses: Try Node.js for $0.02 or less in just a few minutes is a short tutorial from the developers of NowJS.

Up and Running With Node.js Up and Running with Node.js by Tom Hughes-Croucher hasn't been officially released yet, but O'Reilly Media has released a free text preview of the book as part of its Open Feedback Publishing System. Our previous coverage of the book is here. The Node Beginner Book The Node Beginner Book by by Manuel Kiessling is a new Node.js e-book. Felix's Node.js Guide Felix's Node.js Guide got a lot of attention this week, particularly the Convincing The Boss section. Mastering Node. The Node Beginner Book. Socket.IO: the cross-browser WebSocket for realtime apps. Felix's Node.js Convincing the boss guide. « Home / All Guides Now that you're all hyped up about using node.js, it's time to convince your boss. Well, maybe. I have had the pleasure of consulting for different businesses on whether node.js is the right technology, and sometimes the answer is simply no.

So this guide is my opinionated collection of advice for those of you that want to explore whether node.js makes sense for their business, and if so, how to convince the management. Bad Use Cases CPU heavy apps Even though I love node.js, there are several use cases where it simply doesn't make sense. That being said, node.js allows you to easily write C++ addons, so you could certainly use it as a scripting engine on top of your super-secret algorithms. Simple CRUD / HTML apps While node.js will eventually be a fun tool for writing all kinds of web applications, you shouldn't expect it to provide you with more benefits than PHP, Ruby or Python at this point.

NoSQL + Node.js + Buzzword Bullshit Good Use Cases JSON APIs Single page apps. Node.js partie 1 - Tout ce que vous devez savoir sur Node.js. Parmi les nombreuses technologies qui me passionnent actuellement, Node.js tient une place importante. Et pour plusieurs raisons : développement Javascript côté serveur, gestion des entrées/sorties de manières non bloquantes, communauté très présente avec de nombreux modules comme Socket.IO et bien d’autres choses encore. C’est pour toutes ces raisons, et aussi parce que la nouvelle version 0.4.0 vient de sortir, que Web Tambouille vous propose une série de 4 billets consacrée exclusivement à votre futur serveur préféré : Node !

Et cela commence dès aujourd’hui avec une petite introduction générale du serveur, ses concepts, les interviews et autres vidéos à ne pas manquer, les liens à connaître… bref un condensé de tout ce que vous devez absolument savoir sur Node ! Présentation Node s’appuie sur V8, le moteur Javascript de Google utilisé dans Chrome, qui fait partie des moteurs Javascript les plus puissants du marché actuellement.

Prenons l’exemple du serveur Apache. Juste pour pinailler. Introduction à node.js - Damien MATHIEU. JSON. Object {} { members } members pair pair , members pair string : value array [] [ elements ] elements value value , elements value string number object array true false null string "" " chars " chars char char chars char any-Unicode-character- except-"-or-\-or- control-character \" \\ \/ \b \f \n \r \t \u four-hex-digits number int int frac int exp int frac exp int digit digit1-9 digits - digit - digit1-9 digits frac . digits exp e digits digits digit digit digits e ee+e-EE+E- JSON (JavaScript Object Notation – Notation Objet issue de JavaScript) est un format léger d'échange de données.

JSON se base sur deux structures: Une collection de couples nom/valeur. Ces structures de données sont universelles. En JSON, elles prennent les formes suivantes: Un objet, qui est un ensemble de couples nom/valeur non ordonnés. Un tableau est une collection de valeurs ordonnées. Une valeur peut être soit une chaîne de caractères entre guillemets, soit un nombre, soit true ou false ou null, soit un objet soit un tableau.