var o = {}; o.__noSuchMethod__ = function ( n , p ) { alert( 'name:' + n + '\nparam: ' + p ); } o.foo( 'preved', 'medved' );