Created
June 16, 2013 16:35
-
-
Save hughfdjackson/5792578 to your computer and use it in GitHub Desktop.
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 isInOrder = function(){ | |
| var args = Array.prototype.slice.call(arguments) | |
| for ( var i = 0, len = args.length; i < len - 1; i += 1) if ( args[i] > args[i + 1] ) return false | |
| return true | |
| } | |
| var identity = function(a){ return a } | |
| var f = identity | |
| isInOrder(1, f(2), 2) //= true | |
| isInOrder(1, f(2), 3) //= true | |
| isInOrder(1, f(-2), 3) //= false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment