A basic interface implementation with javascript