mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 10:01:38 +00:00
[javascript/en] Enforce 80-char line width
This commit is contained in:
parent
40f2b2d9d5
commit
9f0ae279d8
@ -107,10 +107,10 @@ false;
|
|||||||
|
|
||||||
// There's also null and undefined
|
// There's also null and undefined
|
||||||
null; // used to indicate a deliberate non-value
|
null; // used to indicate a deliberate non-value
|
||||||
undefined; // used to indicate a value is not currently present (although undefined
|
undefined; // used to indicate a value is not currently present (although
|
||||||
// is actually a value itself)
|
// undefined is actually a value itself)
|
||||||
|
|
||||||
// false, null, undefined, NaN, 0 and "" are falsy, and everything else is truthy.
|
// false, null, undefined, NaN, 0 and "" are falsy; everything else is truthy.
|
||||||
// Note that 0 is falsy and "0" is truthy, even though 0 == "0".
|
// Note that 0 is falsy and "0" is truthy, even though 0 == "0".
|
||||||
|
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
@ -306,8 +306,8 @@ myObj.myOtherFunc = myOtherFunc;
|
|||||||
myObj.myOtherFunc(); // = "HELLO WORLD!"
|
myObj.myOtherFunc(); // = "HELLO WORLD!"
|
||||||
|
|
||||||
// When you call a function with the new keyword, a new object is created, and
|
// When you call a function with the new keyword, a new object is created, and
|
||||||
// made available to the function via the this keyword. Functions designed to be called
|
// made available to the function via the this keyword. Functions designed to be
|
||||||
// like that are called constructors.
|
// called like that are called constructors.
|
||||||
|
|
||||||
var MyConstructor = function(){
|
var MyConstructor = function(){
|
||||||
this.myNumber = 5;
|
this.myNumber = 5;
|
||||||
|
Loading…
Reference in New Issue
Block a user