adding a new memeber to all objects in javascript May 12, 2010 • Fred Yang function Person(){} var root = Object.prototype; root.say = function () { alert("hi"); } Person.say(); var p = new Person(); p.say(); Please enable JavaScript to view the comments powered by Disqus.