Javascript the Old way and the New way