a simple JavaScript code