Click to See Complete Forum and Search --> : functions


Help
05-15-2003, 01:57 PM
what built-in JavaScript function is used to convert a string into a number?

khalidali63
05-15-2003, 02:02 PM
parseInt("4");
and Number("4")

I hope thats what you eanted..:-)

Help
05-15-2003, 02:04 PM
it is thanx!

Help
05-15-2003, 02:06 PM
hey Khalid, what's the process of reserving the memory space for the variable before it is used?

Jona
05-15-2003, 02:13 PM
var myVar; // make global

function boo(){
alert(myVar);
}

function foo(){
alert(myVar);
}

khalidali63
05-15-2003, 02:28 PM
A simple declaration of a variable reserves space in memory for it.

e.g

var num;

Jona
05-15-2003, 02:29 PM
I know, but I was just giving an example to prevent him from posting a new question, "How to send variable values from one function to another." lol

Help
05-15-2003, 02:35 PM
no, i was just going to ask what the process is actually called.

havik
05-15-2003, 03:29 PM
??

A variable declaration?

Havik