mozilla

Compare Revisions

A re-introduction to JavaScript (JS tutorial)

Change Revisions

Revision 18640:

Revision 18640 by marcello.nuccio on

Revision 18641:

Revision 18641 by manuelp on

Title:
A re-introduction to JavaScript (JS Tutorial)
A re-introduction to JavaScript (JS Tutorial)
Slug:
JavaScript/A_re-introduction_to_JavaScript
JavaScript/A_re-introduction_to_JavaScript
Tags:
javascript
javascript
Content:

Revision 18640
Revision 18641
n235      If you declare a variable without assigning any value to itn235      If you declare a variable without assigning any value to it
>, its type is <code>undefined</code>. <span class="comment">shoul>, its type is <code>undefined</code>.&nbsp;
>d note the absence of block-scoping in JS</span> 
236    </p>
237    <p>
238      An important difference with other languages like Java is t
 >hat in JavaScript blocks do not have scope. Only functions have s
 >cope. So if a variable is defined with <code>var</code> in a comp
 >ound statement (for example inside an <code>if</code> control str
 >ucture), it will be visible to the entire function.
239    </p>
240    <p>
241      &nbsp;
nn324var input;
t319  var input = get_input();t326  input = get_input();

Back to History