Thursday, 15 August 2013

Another Javascript Undefined Null Question -


So I have done most of the questions here. Apart from this, some articles are good and bad

One thing I am looking for for some additional explanation is how to treat undefined and un-declared variables

Take the code below.

  var a If (a == null) // is true due to pressure (a == 'null') // false then (a === faucet) // false if (a === 'null') // false If (a == undefined) // True if (a === undefined) // True if (a == 'undefined') // false (a === 'undefined') // False if (a) // false-A is undefined warning (typef (a)) // undefined  

I understand all of the above. But when you look at the undeclared variable, things are weird Note: I'm specifically leaving a "var b".

  Alert (typef (b)) // Undefined if (typef (b) == 'undefined') / True if (typeof (b) === 'undefined') // true - It indicates that the function typef is returning a string value if (typef (b) == 'empty') / / false (if type (b) === 'null') // false if (typef (b) == faucet) // Fellus if (typef (b) === blank) // false (b) // runtime error - b is undefined  

any other type of operation then type (B) Results in a runtime error. Yet I can understand the way the expression is being evaluated.

So now I see a non-existent property and are really confused.

  If (AC) // runtime error - C is zero or not an object alert (typef (AC)) // runtime error - is undefined or not an object  

I would think that in this case c will be treated like b in the previous example, but not its You have to start a bit to actually do something, so you can get it as the behavior of B. And stop throwing runtime errors.

Why is that so? Are there some special handling types of undefined type or what kind of methodology that has been repeatedly doing some time to evaluate the depreciating sub-property?

  1. I think there is a practical question here: I am looking at Nested Object C in AC, can I guess immediately if someone is undefined?

  2. And what's the best way, if I want to see some highly nested objects, whether it was set in MyObject like X. Some. some. some. X? I have to navigate through the element through the element of the element so that each one is present before going down to the next one in a series?

    Yes.

    I can post "itemprop =" text ">

    Can I immediately assume that is undefined if someone is undefined?

    > I have to navigate through the element through the element of the element so that make sure that each one is present before going below the next one in the moon?

    Yes .


    No comments:

    Post a Comment