Get Ready To Prank Your Coder Friends With A Simple Code!
Just rewrite the console.log function with:
var $old_consoleLog = console.log;
console.log = function(String){
$old_consoleLog("Bonkers: " + String);
}
Explanation:
var $old_consoleLog = console.log;
Stores console.log function as another variable: "$old_consoleLog"
Don't let your coder friend find out this variable
console.log = function(String){
$old_consoleLog("Bonkers: " + String);
}
Rewrites original console.log function to output "Bonkers: ...";
Can also replace "Bonkers with any other Value as Prefix"
Can Revert Changes with:
console.log = $old_consoleLog;
Reaction: What? Why Console.log Is Adding Bonkers to its output?
Top comments (4)
Such a great idea XD
XD
:D XD
Anyone Got Pranked With This Code?