From: transkawa on


these are my newbie lessons in javascripts.just wanted to share them.
1. never take literals for granted, especially when you're going to use
them for evaluating logical expressions. typeof myobj where myobj is
declared var myob = 'true'; could return string when you are thinking of
booleans. note for newbies like myself.
whenever you tend to use literals, have eval function handy.
2. whenever you parseInt or parseFloat, return Number.NaN where you
expect an error. you can spend a whole day wondering what the problem is
without NaN.
lessons learnt from sweating it out.
xnt
--
happy are those who have endured
for they shall reap bountifully
--the gospel according to an avatar
From: David Mark on
On Jun 8, 1:51 pm, transkawa <transk...(a)yahoo.fr> wrote:
> these are my newbie lessons in javascripts.just wanted to share them.
> 1. never take literals for granted, especially when you're going to use
> them for evaluating logical expressions. typeof myobj where myobj is
> declared var myob = 'true'; could return string when you are thinking of
> booleans. note for newbies like myself.
> whenever you tend to use literals, have eval function handy.

The lesson is not to think of string literals as booleans. The next
lesson is to forget that eval exists.

> 2. whenever you parseInt or parseFloat, return Number.NaN where you
> expect an error.

I can't make heads or tails of that.

> you can spend a whole day wondering what the problem is
> without NaN.

You can spend a lifetime wondering or a considerably shorter period
learning.

> lessons learnt from sweating it out.

You seem to be on the wrong course.
From: Thomas 'PointedEars' Lahn on
David Mark wrote:

> On Jun 8, 1:51 pm, transkawa <transk...(a)yahoo.fr> wrote:
>> [...]

Is it too much to ask for to look a bit harder and to not feed the trolls?

--
PointedEars