Created
December 5, 2011 00:49
-
-
Save favrik/1431827 to your computer and use it in GitHub Desktop.
Why .apply is awesome
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
// Set container height to highest list | |
var heights = $('.articleSection').map(function() { | |
return $(this).innerHeight(); | |
}).get(); | |
console.log(heights); | |
var max = Math.max.apply(Math, heights); | |
//$('.articlesWidget .wrapper').height(max); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Math.max only accepts parameters as a comma separated list.