How can I create a method in JS like an abstract method in Java?
<p>I'm building a small game - rock paper scissors.</p>

<p>I have a prototype - <code>RPSPlayer</code> and I have two kinds of players: <code>Player1</code> , <code>Player2</code> (player1 &amp; player2 are objects with a prototype of RPSPlayer) each player plays with the function: <code>Player1.play()</code>.</p>

<p>Each player has a different strategy for the game. Thus, I need 2 implementations for <code>play()</code>. If it was Java, I would create an abstract class <code>RPSPlayer</code> with an abstract method <code>play()</code> and 2 other classes which inherit from <code>RPSPlayer</code>; each of them would have its own implementation for <code>play()</code>.</p>

<p>My question is: what is the correct way to do it in JS? I hope I made myself clear, thanks everyone.</p>
