Sample JS loop implementations.