This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 iterations = Math.floor(values.length / 8); | |
var leftover = values.length % 8; | |
var i = 0; | |
if ( leftover > 0 ) | |
{ | |
do { | |
process( values[i++] ); | |
} while ( --leftover > 0 ); | |
} | |
do { |
This file contains hidden or 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 |
This file contains hidden or 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
<p> | |
<b>This is important</b> | |
</p> |
This file contains hidden or 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 i, temp, | |
frag = document.createDocumentFragment(), | |
li = document.createElement('li'); | |
for ( i=0; i<3; i++ ) | |
{ | |
temp = li.cloneNode( true ); | |
temp.appendChild( | |
document.createTextNode( | |
'This is new list item number ' + ( i + 1 ) | |
) |