object oriented javascript - inheritance implementation

I have two module with very similar methods (it is a part of an adapter pattern that implements the same methods/interface). The differences are in two lines of code:

function MyModuleA{

}

ModuleA.prototype.myMethod = function{
           --LineA--
           --LineB--
           --LineC--
           --LineD--
}

function MyModuleB{

}

ModuleB.prototype.myMethod = function{
           --LineA--
           **--LineE--**     //different line
           --LineB--
           --LineC--
           **--LineF--**     //different line
           --LineD--
}

Can I use javascript inheritance to implement the similar lines only once?

Thanks!!

Answers


Need Your Help

An unexpected error occurred in the IBM DB2, IDS, and U2 Data Provider for .NET Framework

.net db2 ibm dataprovider

When i try to install latest beta tools for Visual Studio 2010 (from here) i get the following error:

how to check time in PHP

php mysql time

I'm making a search page of a sport (badminton) where each team plays: morning, afternoon, evening. There can be three play times in a week. So the table is like this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.