JavaScript optimization test