no, they mean quite different things.

In the first case you are creating a Number object, then you are assigning the string '0' to it, so it becomes a string.

In the second one you are creating a Number object from a string, so you end up with the value of the string in your Number object.

if in the first case you did :

var myVar = new Number();
myVar = 0;

then they would be about the same, but you may as well write

var myVar = 0;

if you need to create numbers from strings then just beware of using leading 0's as a recent thread discussed this leads flash to interpret the string as an octal number (base 8).

martin


Toon Van de Putte wrote:
I was wondering if the following two lines of code are just different ways
of doing the same thing:

var myVar = new Number();
myVar ="0";

var myVar= Number("0");

--
Toon Van de Putte
Pannenhuisstraat 63
2500 Lier
Belgium

mobile: +32 (0)497 52 74 51

[EMAIL PROTECTED]
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--
Martin Wood

http://relivethefuture.com/choronzon
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to