![]() Topic awaiting preservation: convert string into number question! (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: NZ |
![]() Hi, guys. Good morning. How are you? quote:
code: <html>
code: function doMoth()
|
Maniac (V) Inmate From: Brisbane, Australia |
![]() 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 |
![]() Hi, Dracusis. code: function cal()
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() 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 |
![]() Hi, Slime. |