Fumio Nonaka wrote:
Using new Number is... silly. The Number-object is quite useless
and can't be used for anything, that a regular number can't. Use
normal numbers and use numbers:
The Number object can have a property, which a regular number can't.
I don't know if it is useful, though.
I kn
The Number object can have a property, which a regular number can't. I
don't know if it is useful, though.
var myVar = new Number(1);
trace(myVar); // Output: 1
myVar.prop = "my property";
trace(myVar.prop); // Output: my property
_
Morten Barklund Shockwaved wrote:
Using new Number is...
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";
Using new Number is... silly. The Number-object is quite useless and
can't be used for anything, that a regular number can't. Use
Toon Van de Putte schrieb:
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");
Except the fact you'd never pass a string ("0") where a number is
expected (0), the only difference betwe
But why not? In the first example you say in the first line myVar = new
Number(); But not more, only that it is a number e.g not a string or a
bolean. Than in the second line you say myVar = "0"; So you give it a
Number.
In the second example you do it in one way you say hey the variable
myVar
Grtz
Hans
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Toon Van de
Putte
Sent: Wednesday, January 25, 2006 2:23 PM
To: Flashcoders mailing list
Subject: [Flashcoders] small code question
I was wondering if the following two lines of code are just diff
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.
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]
___
8 matches
Mail list logo