a simple JS exercise