This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f( a ) | |
{ | |
if ( a == 1 ) | |
{ | |
// do something | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( a++, b == 5 ) | |
{ | |
// always increments a, but ONLY enters the block if b == 5 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function someFunction( n ) | |
{ | |
n |= 1; | |
// same as n = n || 1; | |
// doesn't work with anything but numbers | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reference = my.complicated.object.reference; | |
for ( var i=0; i<100; i++ ) | |
{ | |
doSomething( reference, i ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function square( n ) | |
{ | |
return n * n | |
}; | |
var i=10000, sum = 0; | |
while ( i-- ) | |
{ | |
sum += square( i ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Rock() | |
{ | |
this.weight = 'a lot'; | |
} | |
Rock.prototype.getWeight = function() | |
{ | |
return this.weight; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( object.propertyName ){ | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( foo == Math.cos( bar * 789 / 25 * 48 ) || | |
foo === true ) | |
{ | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
style = document.createElement('style'), | |
addRules = function( el, styles ) | |
{ | |
el.appendChild( document.createTextNode( styles ) ); | |
}; | |
if ( defined( style.styleSheet ) ) | |
{ | |
addRules = function( el, styles ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExpiresActive on | |
ExpiresByType text/css "access plus 5 years" | |
ExpiresByType application/x-javascript "access plus 5 years" | |
ExpiresByType text/javascript "access plus 5 years" | |
FileETag none |