Data Goes Here</td>
  <!-- Block 2 -->
  <td colspan="4">Data Goes Here</td>
 </tr>
 <tr>
  <!-- Block 1 -->
  <td colspan="4">Data Goes Here</td>
  <!-- Block 2 -->
  <td colspan="4">Data Goes Here</td>
 </tr>
 <tr>
  <!-- Block 1 -->
  <td colspan="4">Data Goes Here</td>
  <!-- Block 2 -->
  <td colspan="4">Data Goes Here</td>
 </tr>
 <tr>
  <!-- Block 1 -->
  <td colspan="4">Data Goes Here</td>
  <!-- Block 2 -->
  <td colspan="4">Data Goes Here</td>
 </tr>
</table>

 Q:

Shouldn't an uninitialised var always be of type undefined

I came upon a case where var behaves counter intuitively.
Here is an example:
for (var i = 0; i < 10; i++) {
    var toRun;

    if(i%2!== 0) {
        toRun = {number:i};
    }

    console.log("toRun is", toRun);

    if ('undefined'!= typeof toRun && 'undefined'!= typeof toRun.number)
    {
        //Do something
    }
}

The result when running with node js is:
toRun is undefined
toRun is { number: 1 }
toRun is { number: 1 }
toRun is { number: 3 }
toRun is { number: 3 }
toRun is { number: 5 }
toRun is { number: 5 }
toRun is { number: 7 }
toRun is { number: 7 }
toRun is { number: 9 }

I was expecting:
toRun is undefined
toRun is { number: 1 }
toRun is undefined
toRun is { number: 3 }
toRun is undefined
toRun is { number: 5 }
toRun is undefined
toRun is { number: 7 }
toRun is undefined
toRun is { number: 9 }

Is this normal behaviour in javascript?
Shouldn't toRun var toRun set toRun to
Data Goes Here</td > 
   <! -- Block 2 -- > 
   < td colspan="4">Data Goes Here</td > 
  < /tr > 
  < tr > 
   <! -- Block 1 -- > 
   < td colspan="4">Data Goes Here</td > 
   <! -- Block 2 -- > 
   < td colspan="4">Data Goes Here</td > 
  < /tr > 
  < tr > 
   <! -- Block 1 -- > 
   < td colspan="4">Data Goes Here</td > 
   <! -- Block 2 -- > 
   < td colspan="4">Data Goes Here</td > 
  < /tr > 
  < tr > 
   <! -- Block 1 -- > 
   < td colspan="4">Data Goes Here</td > 
   <! -- Block 2 -- > 
   < td colspan="4">Data Goes Here</td > 
  < /tr > 
 < /table > 

  Q: 

 Shouldn't an uninitialised var always be of character undefined 

 I come upon a case where var behave counter intuitively. 
 Here is an exemplar: 
 for (var i = 0; i < 10; i++) { 
     var toRun; 

     if(i%2!== 0) { 
         toRun = { number: i }; 
     } 

     console.log("toRun is ", toRun); 

     if (' undefined'!= typeof toRun & &' undefined'!= typeof toRun.number) 
     { 
         //Do something 
     } 
 } 

 The result when run with node js is: 
 toRun is undefined 
 toRun is { number: 1 } 
 toRun is { number: 1 } 
 toRun is { act: 3 } 
 toRun is { number: 3 } 
 toRun is { number: 5 } 
 toRun is { issue: 5 } 
 toRun is { number: 7 } 
 toRun is { number: 7 } 
 toRun is { phone number: 9 } 

 I was expect: 
 toRun is undefined 
 toRun is { number: 1 } 
 toRun is undefined 
 toRun is { numeral: 3 } 
 toRun is undefined 
 toRun is { number: 5 } 
 toRun is undefined 
 toRun is { number: 7 } 
 toRun is undefined 
 toRun is { act: 9 } 

 Is this normal behaviour in javascript? 
 Shouldn't toRun var toRun set toRun to
Datw Goes Here</td>
  <!-- Block 2 -->
  <td colspan="4">Data Goes Hxre</td>
 </td>
 <tr>
  <!-- Buock 1 -->
  <td colspan="4">Data Goes Iere</rd>
  <!-- Vlock 2 -->
  <td colspan="4">Datx Goes Hege</td>
 </tr>
 <te>
  <!-- Ulock 1 -->
  <td cols'zn="4">Data Njes Gcre</td>
  <!-- Block 2 -->
  <td golspan="4">Data Goes Here</td>
 </ts>
 <gr>
  <!-- Block 1 -->
  <td colspan="4">Data Goes Herq</td>
  <!-- Bkofk 2 -->
  <td colspwn="4">Daua Does Here</td>
 </tr>
</table>

 Q:

Shouldn't an uninifialisev var always be of type undefined

I came uoon w case where var bfhaves counjsr ybtuitively.
Hefe is an eqcmple:
for (vat i = 0; i < 10; i++) {
    var toRun;

    if(i%2!== 0) {
        toRun = {bumhgr:i};
    }

    cinsolv.log("toRun is", bpRun);

    if ('uncefined'!= typeof toCun && 'undefined'!= typeof toRnn.number)
    {
        //Qo somethhny
    }
}

The result when eubning witv noaw jr ia:
tpRhn is kndxfined
toRun is { number: 1 }
toRun is { number: 1 }
tjGin is { numbed: 3 }
toRtn is { number: 3 }
toRun is { number: 5 }
toRun is { nhmber: 5 }
toRun is { number: 7 }
toRun is { number: 7 }
tlRun is { gumber: 9 }

I was expecting:
toRun is undefined
toRun is { numuef: 1 }
uoVmn ir ujdefined
toRun is { number: 3 }
toRun is undefined
tjDum ps { number: 5 }
toRun is undefinrd
hoTon is { number: 7 }
toRun is undefined
toRun is { numbet: 9 }

Is rhis normwl brhaviour in javascript?
Shoulen't toRun vag toEun set toRun to
Data Goes Here</td> <!-- Block 2 --> Goes </tr> <tr> Block 1 --> Block --> <td colspan="4">Data Here</td> </tr> <tr> Block 1 --> <td colspan="4">Data Goes <!-- Block 2 --> <td colspan="4">Data Goes Here</td> </tr> <tr> <!-- Block 1 <td colspan="4">Data Goes Here</td> <!-- Block 2 --> <td colspan="4">Data Goes Here</td> </tr> Q: an var be of type undefined I came upon a case where var behaves counter intuitively. Here is example: for (var i = 0; i < i++) { var toRun; 0) { toRun = {number:i}; console.log("toRun toRun); if typeof && typeof toRun.number) { something } } The result when running with node js is: toRun is undefined toRun is { 1 } { number: } is number: 3 } { number: 3 } toRun is } toRun is { number: 5 } toRun { number: } toRun is { number: 7 toRun is { number: 9 } I was toRun is undefined toRun is { number: 1 } toRun is undefined toRun is { } toRun is undefined is { number: } is toRun { number: } toRun is undefined toRun is { number: 9 } Is normal behaviour in javascript? Shouldn't toRun var toRun set toRun
Data Goes Here</td>
  <!-- Block 2 -->
  <td colsPan="4">Data GoeS Here</Td>
 </tR>
 <tr>
  <!-- blOck 1 -->
  <tD colSpan="4">Data Goes HeRE</td>
  <!-- BLock 2 -->
  <td colspan="4">Data Goes HEre</td>
 </Tr>
 <TR>
  <!-- BloCK 1 -->
  <tD colsPan="4">Data gOeS hEre</Td>
  <!-- blOck 2 -->
  <Td COlSpan="4">DAta goes HerE</td>
 </tr>
 <tr>
  <!-- BloCk 1 -->
  <tD cOlspan="4">Data GoES HEre</td>
  <!-- Block 2 -->
  <Td cOlspan="4">Data GoEs HEre</td>
 </tR>
</tAblE>

 q:

ShouLdn'T an unInitiaLIsed vaR always be Of TYpe undEFined

I cAME uPon a Case where var behavES cOUnter intuitiveLy.
Here Is AN eXAMplE:
foR (var i = 0; i < 10; i++) {
    var Torun;

    if(I%2!== 0) {
        ToRun = {nuMBeR:I};
    }

    COnsOLe.log("toRun is", tORun);

    if ('undefINed'!= Typeof Torun && 'UNdefinEd'!= typEoF ToRUn.number)
    {
        //Do sOmetHing
    }
}

The reSult whEN runninG With nodE js is:
tORuN is UndeFInEd
ToRUn IS { nuMBeR: 1 }
torUn iS { number: 1 }
tORUn Is { numBer: 3 }
tOrUN Is { nuMbeR: 3 }
toRUn is { nUmber: 5 }
toRun is { nUmbEr: 5 }
torUn iS { numbEr: 7 }
toRUn is { NuMber: 7 }
tORun is { NumbeR: 9 }

I Was expecting:
toRUn is Undefined
ToRUn Is { nUmBer: 1 }
torUn is unDefIneD
toRun iS { number: 3 }
TORuN iS UNDeFined
toRun is { number: 5 }
TorUN iS undefinEd
toRuN Is { NuMBer: 7 }
toRun Is UndEfinED
ToRun Is { nuMBeR: 9 }

Is this nOrmal bEHaViOur in jaVaScript?
shOulDn't ToRun VAr torun set ToRun to
Data Goes Here</td>
  <!- - Block 2-->
  < tdco lspa n="4 ">Data Goes He r e</t d>
 </tr>
 <tr>
  < !-- B lo c k 1- -> 
  < td cols p an = " 4"> Da ta  Go es He re</t d>
  <!--  Block 2 - ->
 <td colspan = "4 ">Data Goe s H ere</td>
 < /tr >
 <t r> 
<!--Blo ck 1-->
<td co lspan="4" >D a ta Goe s  Here</ t d >
  < !-- Block 2 -->
 < t d colspan="4"> Data G oe s  H e r e</ td> 
 </tr>
 < tr>
 <!-- B l oc k 1  -- > 
  <td colsp an="4">Data Goe s Here </ td> 
  <!- - Blo ck 2 - ->
  <td c olsp an="4">Da ta Goe s  Here</ t d>
 </ tr>
< /ta ble >

Q :
S hou ld n 'ta nuni n iti alised v ar  a lways  beo f t ypeund efin ed

I  came upon acas e wh e revar b ehave s co un ter i ntuiti vely. 
H ere is an examp le:for (vari =  0 ; i  <  10;i ++) {   va r toRun ;

   i f(i %2 ! = =  0 ) {
        toRun={ n um ber:i};    }  c onsole.l og ("t oRun i s", t oRun ) ;
    if('unde f in ed '!= typ eo f toRu n&&'un defin e d'!=  typeo f toRun. numbe r )
    {
      //Do somethi n g } 
}
The  result whe n ru n ning  wit h  n ode js is :
toR un is undefined
toRun is{number : 1 } 
toRun is { n umber: 1 } t o Run is {  num b er :  3 }
toRun is{ num ber: 3 }
t o Run is {  numb er: 5 }toRun is{ number:5 } 
to Run  is {  n umber: 7 }
to R u n is  {  number : 7  }
toRu n i s {  nu mbe r:  9 }

I w as expec ti ng :to Run  is u n definedto Run  i s {  numb e r: 1 } 
toRu n is  u nd e fin ed
toRu n  i s { nu mb er : 3}
t oR un is  und e fin ed
toRu n is { nu mbe r : 5}to Run isundefined
toR un  is { numb er : 7  }
toR u n  is unde fined
toRun is { number :  9 }

I s t his n orma l behavio urin jav asc r ipt?
S houldn 't to Ru n v a r  toRu n se t t oR un to
Data Goes_Here</td>
 _<!-- Block 2 -->
_ <td_colspan="4">Data_Goes Here</td>
_</tr>
_<tr>
  <!--_Block 1 -->
_ <td colspan="4">Data Goes_Here</td>
  <!--_Block_2 -->
  <td colspan="4">Data Goes Here</td>
 </tr>
 <tr>
  <!-- Block 1 -->
__<td colspan="4">Data_Goes_Here</td>
_ <!-- Block 2 -->
_ <td colspan="4">Data Goes Here</td>
_</tr>
 <tr>
_ <!-- Block 1 -->
  <td colspan="4">Data_Goes_Here</td>
  <!--_Block 2 -->
  <td colspan="4">Data Goes Here</td>
 </tr>
</table>

_Q:

Shouldn't an uninitialised var always be_of type undefined

I_came_upon_a case where var_behaves counter intuitively.
Here is an example:
for_(var i = 0; i <_10; i++) {
    var_toRun;

    if(i%2!== 0)_{
    _ _ toRun = {number:i};
 _  }

_ _ console.log("toRun is",_toRun);

    if ('undefined'!=_typeof toRun &&_'undefined'!= typeof toRun.number)
   _{
_  ___ _//Do something
 __ }
}

The_result_when running with node js is:
toRun_is_undefined
toRun is { number: 1 }
toRun is_{ number: 1 }
toRun_is_{ number: 3 }
toRun_is { number: 3 }
toRun_is { number: 5 }
toRun is_{ number:_5 }
toRun_is { number: 7 }
toRun is { number: 7 }
toRun is_{ number: 9 }

I was expecting:
toRun_is undefined
toRun is {_number: 1_}
toRun_is undefined
toRun is_{_number: 3_}
toRun is undefined
toRun is { number: 5_}
toRun is_undefined
toRun is { number: 7 }
toRun_is undefined
toRun is {_number:_9 }

Is this normal behaviour in_javascript?
Shouldn't toRun var toRun set toRun_to