Saturday, December 1, 2012

Javascript object comparison

This article has been moved here

http://ronanquillevere.github.io/2012/12/12/javascript-object-comparison.html





-- old version --




Hello everyone,

Today, working on an elegant message box system for our Sencha Touch mobile application I asked myself the following question : How does the === operator works when comparing objects ?

Well I found this article useful : http://javascript.about.com/od/byexample/a/objectoriented-compareobject-example.htm

The fundamental point is, when you assign an object to a var in javascript, this var is on only a reference to the object. The  === comparator will compare the object your reference is pointing on. The following code will only display 'true' values.

var ob1, ob2, ob3;
ob1 = {prop1: 'a', prop2: 'b'};
ob2 = {prop1: 'a', prop2: 'b'};
ob3 = ob1;
if (ob1 === ob2) alert('false');
if (ob1 === ob3) alert('true');
ob3.prop3 = 'c';
if (ob1 === ob3) alert('true');
if ('c' === ob1.prop3) alert('true');

Now if you want to re-write an equal method in javascript for 2 different objects having the same properties you should have a look at the following thread on Stackoverflow :

http://stackoverflow.com/questions/1068834/object-comparison-in-javascript

Wednesday, August 8, 2012

Javascript videos from Douglas Crockford

This article has been moved here

http://ronanquillevere.github.io/2012/08/08/douglas-crockford-video.html





-- old version --




I think everyone writting Javascript code should watch the following videos from Douglas Crockford. Usefull

Chapter 1 The early years :



Chapter 2 And Then There Was JavaScript :  




Chapter 3 Function the Ultimate : 



Chapter 4 The Metamorphosis of Ajax : 



Chapter 5 The End of All Things : 



Monday, August 6, 2012

Chrome Dev Tools docked right


This article has been moved here

http://ronanquillevere.github.io/2012/08/06/chrome-dev-tools-right.html





-- old version --





Want to have your chrome dev tools docked right because it is much more convinient when you are using 1900*1080 display ?

Well it is easy, simply open the dev tools settings (bottom right wheel) and check "Dock to right" in the general settings ...

Enjoy

Thursday, August 2, 2012

First Post

Hello Everyone,

My name is Ronan Quillevere. I am a web software engineer. Here I will be talking about web programming and HTML5 stuff. I will share some code, inspiring web sites, links about nice libs etc.

I love beautifull things and I am pationate about design (and web design) so I will try to always keep that in mind in my posts and in the code I will be sharing.

Hope you will enjoy reading this blog.