Boolean comparisons in JavaScript

//inside a condition, undefined, null and '' (empty string) - they all are equivalent to boolean false.

But that is only half the truth. It is very important to know that the following statements return false.

(undefined == false);
(null == false);
('' == false);

Posted at 18:24 on January 27, 2010 | 5 comments | Filed Under: JavaScript | read on

Why to use DOM 2 event listeners?

document.getElementById(“myButton”).onclick = function(e) {     //do something }; What’s wrong with this approach of assigning handler to an event? If you ask me, I can think of at least 4 reasons not to follow it. It looks really ugly. If multiple programmers are working on the same interface, there might be situations you won’t be aware [...]

Posted at 22:45 on July 20, 2009 | leave a comment | Filed Under: JavaScript | read on

About

User Interaction Architect | Life is fun | Bikes, cars and cameras | OOPs with JavaScript | Web User Experience | Usability | Accessibility | Web Standards | Requirement Analysis | Wireframes & Interactive mock-ups | Kids | Nature | Road Trips | Photography | Dogs | Spicy food | Chocolate Ice-cream | Julia Roberts | Samantha Brown on Discovery Travel & Living | Any kind of foot tapping music | PSP.

Still looking for more? Write to kumarbhot@yahoo.com.

Not Just A Thought…

Fantasies have to be unrealistic. Because the moment, the second that you get what you seek, you don’t.- you can’t- want it anymore. In order to continue to exist, Desire must have its objects perpetually absent. It’s not the ‘It’ that you want, it is the fantasy of ‘It’. So, Desire supports crazy fantasies.

This is what [Blaise] Pascal means when he says that we are only truly happy when daydreaming about future happiness. Or why we say: “The hunt is sweeter than the kill”. Or “Be careful what you wish for”. Not because you’ll get it. Because you’re doomed not to want it once you do.

So the lesson of Lacan is: Living by your wants will never make you happy. What it means to be fully human is to strive to live by ideas and ideals and not to measure your life by what you have attained by your desires but those small moments of integrity, compassion, rationality, even self-sacrifice. Because in the end, the only way that we can measure the significance of our own lives is by valuing the lives of others.

- Abstract of Prof. Gale's speech from the movie "Life of David Gale"

..........................................................................

It is good to see ourselves as others see us. Try as we may, we are never able to know ourselves fully as we are, especially the evil side of us. This we can do only if we are not angry with our critics but will take in good heart whatever they might have to say.

- Mahatma Gandhi


Follow

Get every new post delivered to your Inbox.