Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by azu.
- * Date: 12/03/29 10:17
- * License: MIT License
- */
- function wrapConsole(code, args) {
- var argStr = JSON.stringify(args || []);
- new Function('console', '(' + code + ').apply(null,' + argStr + ')')({
- log:function () {
- // arguments ["コンソール", [].slice.apply(arguments).join("+")]
- alert([].slice.apply(arguments).join(''));
- }
- });
- }
- wrapConsole(function () {
- // arguments [1,2,3]
- console.log("コンソール", [].slice.apply(arguments).join("+"));
- }, [1, 2, 3]);
Add Comment
Please, Sign In to add comment