var a = {};
// && = and , || = or , ! = not , === = absolute equal to , == = equal to but does not need to be absolute (this one is very complicated to use, I can't explain its all here, just don't use this one if you do not really have to.)
// = = declaring a variable, !== = not equal to.
function check(input){
if ( input === null || input === undefined ){
alert("Variables wasn't defined");
}
if ( input.length === 0 ){
alert("This is a declared but empty variable");
}
if ( !input ){
alert("I'm empty, false, NaN, 0, undefined or empty");
}
alert( typeof(input) ); // This will tell you what type I am.
if ( typeof(input) === "object" && input instanceof Object && input instanceof Array ){
alert( "I'm an Array, which is also an Object in Javascript" );
alert( "I can be an Object and not be an Array, however if am an Array I am also a class of object") ;
alert( "Notice how typeof tell you I'm an Object although I am an Array" );
}
if ( input instanceof Object && !(input instanceof Array) ){
alert( "I am for sure an Object but not an Array" );
}
}
check(a)
if (strValue) {
//do something
}
ForumWeb.Hosting is a web hosting forum where you’ll find in-depth discussions and resources to help you find the best hosting providers for your websites or how to manage your hosting whether you are new or experienced. You’ll find it all here. With topics ranging from web hosting, internet marketing, search engine optimization, social networking, make money online, affiliate marketing as well as hands-on technical support for web design, programming and more. We are a growing community of like-minded people that is keen to help and support each other with ambitions and online endeavors. Learn and grow, make friends and contacts for life.
The world's smartest hosting providers come here to discuss & share what's trending in the web hosting world!