JS Magic

by Scott Kaye

JavaScript

console.clear();

var i = 0;
var fn = function() { };

console.log("fn is currently:", fn);

fn.valueOf = () => "Something";

console.log("fn is now:", fn);

fn.__proto__.valueOf = function() {
	console.log("why?", i++);
};

console.log("i value:", i);