Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Dirty Javascript reproduction of
// Dirty overload the native function
var parseInt = function(arg1) {
if (arg1 === "Infinity") {
return NaN;
if (arg1 === "Infinity+1") {
return "Infinity1";
if (arg1 === "1+1+1") {
return "3?";
if (arg1 === "") {
return "stop it";
if (arg1 === parseInt) {
console.error("Getting really tired of your bullshit");
// Then do the magic like at
parseInt("Infinity") // NaN
parseInt("Infinity+1") // "Infinity+1"
parseInt("1+1+1") // 3?
parseInt([]+[]+[]) // "stop it"
parseInt(parseInt) // "Getting real tired of your bullshit.."

This comment has been minimized.

Copy link

raigorx commented Jul 30, 2017

Funny now you can driver to crazy a coworker overwritten built-in methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.