[Javascript] typeof

BEKIM BACAJ Trojani2000 at hotmail.com
Fri May 18 10:59:22 CDT 2001


If it returns [object]
It is existant but maybe it has'nt properties
try to read its content and get to know what is it by doing this in the proces of the problem point; insert:  

var whatsThisObject = "" + nameID.substring(nameID.length - nameID.length, nameID.length)
alert(whatsThisObject)

(! do not omit the: ""  !)-it is done to get sure that we get it as a string

This way you will get anything on that object in a string displayed in the alert box;
if it has any content or name it can be read in alrt box.

If "undefined", "null" or "   " empty, that means that the objects are anihilated at that point of randevouz
"Two identical beigns can not egzist in the same time and in the same space"
My advise is, -try to avoid redoundacy in naming vars. Even global variable can be mixed with the value of the local variable
in practice local variable assingns the new value to the global variable if they share the same name douring time that the function is executed
the can even get anihilated, or asimilate into one, depends which one takes it all.

Hope this helps to solve you're problem more faster.
Cheers



----- Original Message -----
From: Andrew Dunn
Sent: Thursday, May 17, 2001 6:49 AM
To: javascript at LaTech.edu
Subject: [Javascript] typeof


Hi,
   I have a variable called nameID. This variable holds the name of another variable which is an array. Sometimes the variable that is held in nameID is non-exsistent ie. "undefined". How can I test this?

I've tried typeof(eval(nameID))) but that returns "object". I need a way to see whether the variable that is held in nameID is exsistent. Can anyone help me?

Thank you.

Andrew Dunn.<br clear=all><hr>Get Your Private, Free E-mail from MSN Hotmail at <a href="http://www.hotmail.com">http://www.hotmail.com</a>.<br></p>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010518/9e22e641/attachment.htm>


More information about the Javascript mailing list