explore the JavaScript magic and put it into best practice