Compare Revisions

Values, variables, and literals

Revision 412751:

Revision 412751 by fergc on

Revision 412755:

Revision 412755 by fergc on

Title:
Values, variables, and literals
Values, variables, and literals
Slug:
JavaScript/Guide/Values,_variables,_and_literals
JavaScript/Guide/Values,_variables,_and_literals
Tags:
"NeedsEditorialReview","JavaScript"
"NeedsEditorialReview","JavaScript"
Content:

Revision 412751
Revision 412755
n252</pre>n252/**
253            <div>253 * Example 1
254              /**254 */
255            </div>
256            <div>
257              &nbsp;* Example 1
258            </div>
259            <div>
260              &nbsp;*/
261            </div>
262            <div>
263              console.log(x === undefined); // logs "true"255console.log(x === undefined); // logs "true"
264            </div>256var x = 3;
265            <div>257 
266              var x = 3;258 
267            </div>259/**
268            <div>260 * Example 2
269              &nbsp;261 */
270            </div>
271            <div>
272              &nbsp;
273            </div>
274            <div>
275              /**
276            </div>
277            <div>
278              &nbsp;* Example 2
279            </div>
280            <div>
281              &nbsp;*/
282            </div>
283            <div>
284              // will return a value of undefined262// will return a value of undefined
285            </div>
286            <div>
287              var myvar = "my value";263var myvar = "my value";
288            </div>264 
289            <div>265(function() {
290              &nbsp;
291            </div>
292            <div>
293              (function() {
294            </div>
295            <div>
296              &nbsp; console.log(myvar); // undefined266  console.log(myvar); // undefined
297            </div>267  var myvar = "local value";
298            <div>268})();
299              &nbsp; var myvar = "local value";269      
300            </div>270</pre>
301            <div>
302              })();
303            </div>
t307</pre>t274/**
308            <div>275 * Example 1
309              /**276 */
310            </div>277var x;
311            <div>
312              &nbsp;* Example 1
313            </div>
314            <div>
315              &nbsp;*/
316            </div>
317            <div>
318              var x;
319            </div>
320            <div>
321              console.log(x === undefined); // logs "true"278console.log(x === undefined); // logs "true"
322            </div>279x = 3;
323            <div>280 
324              x = 3;281/**
325            </div>282 * Example 2
326            <div>283 */
327              &nbsp;
328            </div>
329            <div>
330              /**
331            </div>
332            <div>
333              &nbsp;* Example 2
334            </div>
335            <div>
336              &nbsp;*/
337            </div>
338            <div>
339              var myvar = "my value";284var myvar = "my value";
340            </div>285 
341            <div>286(function() {
342              &nbsp;287  var myvar;
343            </div>
344            <div>
345              (function() {
346            </div>
347            <div>
348              &nbsp; var myvar;
349            </div>
350            <div>
351              &nbsp; console.log(myvar); // undefined288  console.log(myvar); // undefined
352            </div>289  myvar = "local value";
353            <div>290})();
354              &nbsp; myvar = "local value";291      
355            </div>292</pre>
356            <div>
357              })();
358            </div>

Back to History