Topic awaiting preservation: convert string into number question! (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: NZ |
posted 05-29-2003 23:32
Hi, guys. Good morning. How are you? quote:
code: <html>
code: function doMoth()
|
Maniac (V) Inmate From: Brisbane, Australia |
posted 05-30-2003 00:35
eval() is a hard one to come to terms with... It will evaluate a string as if it's contents were JavaScript code. In other words, if you have a string value that can be executed as JavaScript code, it will execute it. |
Paranoid (IV) Inmate From: NZ |
posted 05-30-2003 01:20
Hi, Dracusis. code: function cal()
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 05-30-2003 05:03
Ah, the thing about JavaScript is that you don't *have* to do the conversion yourself. When JavaScript sees that you're trying to multiply two strings together, it realizes that it can't multiply strings, so it *automatically* converts the strings into numbers for you. |
Paranoid (IV) Inmate From: NZ |
posted 05-30-2003 05:22
Hi, Slime. |