An example of using MPV pattern in JavaScript (under construction)