Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getType(f) {
- function TypeWrapper(arg) {
- var type = {}.toString.call(arg).slice(8, -1); ///// ???????????????????????????
- return f.call(this, arg);
- }
- return TypeWrapper;
- }
- function formatDate(date) {
- alert(TypeWrapper.type); ///// ???????????????????????????
- }
- formatDate = getType(formatDate);
- formatDate('2011-10-02'); // 02.10.11
- formatDate(1234567890); // 14.02.09
- formatDate([2014, 0, 1]); // 01.01.14
- formatDate(new Date(2014, 0, 1)); // 01.01.14
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement