An example of using MPV pattern in JavaScript