I want to check whether string is empty or not
when i create object=Shared.getLocal("abc");
it assigns undefinded to the object at the first time
if(object.data.name=="undefnied") {
// is this correct
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the hasOwnProperty function to test if the variable exists. For example:
if ( object.data.hasOwnProperty("name") ){ // Ok. object.data.name exists... var value_of_name : String = String(object.data["name"]); // Check for non-null, non-empty if ( value_of_name ){ // Ok. It is a non-null, non-empty string // ... } }