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
for (var i = 0, j = $elements.length; i < j; i++) { | |
element = elements[i]; | |
// Bind events, do whatever here | |
} |
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
<!DOCTYPE html> | |
<!--[if IEMobile 7 ]> <html dir="ltr" lang="en-US"class="no-js iem7"> <![endif]--> | |
<!--[if lt IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie6 lt-ie7 lt-ie8 lt-ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie7 lt-ie8 lt-ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 8 ]> <html dir="ltr" lang="en-US" class="no-js ie8 lt-ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 9 ]> <html dir="ltr" lang="en-US" class="no-js ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 10 ]> <html dir="ltr" lang="en-US" class="no-js ie10"> <![endif]--> | |
<!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html dir="ltr" lang="en-US" class="no-js"><!--<![endif]--> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 names = ['George', | |
'Ringo', | |
'Paul', | |
'John']; | |
for(var i = 0, j = names.length; i < j; i++) { | |
doSomethingWith(names[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
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
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 CheckNums(num1,num2) { | |
if(num2 > num1) { | |
return true; | |
} else if(num1 === num2) { | |
return -1; | |
} else { | |
return false | |
} | |
} |
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 SimpleAdding(num) { | |
var total = 0; | |
for(i = 1; i <= num; i++) { | |
total += i; | |
} | |
// code goes here | |
return total; | |
} |
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 LongestWord(sen) { | |
longest = ""; | |
// code goes here | |
var words = sen.split(" "); | |
for(i = 0; i < words.length; i++) { | |
if(words[i].length > longest.length) { | |
longest = words[i]; | |
} | |
} | |
return longest; |
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 FirstFactorial(num) { | |
var factorial = 1; | |
// code goes here | |
for(i = 2; i <= num; i++) { | |
factorial *= i; | |
} | |
return factorial; | |
} | |
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
// http://coderbyte.com/CodingArea/GuestEditor.php?ct=First%20Reverse&lan=JavaScript | |
function FirstReverse(str) { | |
var string = []; | |
for(i = 0; i <= str.length; i++) { | |
string[i] = str[str.length - i]; | |
} | |
// code goes here | |
return string.join(""); | |
} | |