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
// Array | |
var x = ['x','x','y','q','x']; | |
var list_no_dupes = function(ogArray) { | |
// Filter and return new array | |
var newArray = ogArray.filter(function(ele, pos) { | |
return ogArray.indexOf(ele) === pos; | |
}); | |
return newArray; | |
}; |
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
// Equal height function (finds tallest of all and matches) takes class/id/html-element | |
var equal_height = function equalheight(element) { | |
maxheight=0; | |
// Find Tallest of elements | |
$(element).each(function(){ | |
maxheight = $(this).height() > maxheight ? $(this).height() : maxheight; | |
}) | |
// Make all elements the same height. | |
$(element).height(maxheight); | |
}; |
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
//Array | |
var y = ["?","X","Z","Q","W","W"]; | |
/*OPTION ONE*/ | |
var find_dupe = function (array) { | |
/* Map Arrays, make uppercase if wanted | |
var yy = array.map(function(x){ return x.toUpperCase() })*/ | |
// Sort function | |
var sorted_arr = array.slice().sort(); // We use slice to clone the array so the original array won't be modified) | |
var results = []; |
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
// Arrays | |
var x = ["7","?","X","X","Q", "?"]; | |
var y = ["?","X","Z","Q", "?", "?"]; | |
var find_dupes = function (array1, array2) { | |
/* Map Arrays, make uppercase if neccessary | |
var xx = array1.map(function(x){ return x.toUpperCase() }) | |
var yy = array2.map(function(x){ return x.toUpperCase() }) */ |
NewerOlder