Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Last active December 19, 2015 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvinmetcalf/5896643 to your computer and use it in GitHub Desktop.
Save calvinmetcalf/5896643 to your computer and use it in GitHub Desktop.
another example
function findC(array){
return array.filter(function(a){
return Array.isArray(a) && a.length === 2;
}).map(function(a){
//x*x is much faster then Math.pow(a,2);
return Math.sqrt(a[0]*a[0]+a[1]*a[1]);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment