Implement common JavaScript algorithms that use sequence, selection, and repetition.
implement common algorithms that use sequence, selection, and repetition in JavaScript