Skip to content

Instantly share code, notes, and snippets.

@tyru
Forked from ujihisa/gist:471778
Created July 12, 2010 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyru/472416 to your computer and use it in GitHub Desktop.
Save tyru/472416 to your computer and use it in GitHub Desktop.
(function () {
if (prompt() == 'ujihisa') {
var Ujihisa = new Function();
Ujihisa.prototype.hi = function () { alert("my name is ujihisa"); };
var the_class = Ujihisa;
}
else {
var Ujm = new Function();
Ujm.prototype.hi = function () { alert("this is a pen"); };
var the_class = Ujm;
}
new the_class().hi();
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment