Created
November 10, 2016 07:52
-
-
Save erayarslan/5f5efeee8a6f8353da1a0e5ddc12b56e to your computer and use it in GitHub Desktop.
_if.js
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 (global) { | |
"use strict"; | |
global._if = function () { | |
var args = arguments; | |
if (args.length == 3) { | |
(args[0] ? args[1] : args[2])(); | |
} else if (args.length == 4) { | |
args[0] ? setTimeout(args[1], args[3]) : setTimeout(args[2], args[3]); | |
} else { | |
throw new Error("something wrong :/"); | |
} | |
}; | |
}(window)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment