Simple interface implementation on JavaScript