Something basic. For me it's nice to enumerate the string as I've seen other do since it is an array of characters adjacent to one another as a solid, contiguous block of memory in most all if not every programming language known to mankind. So from there,, we can logically use the current index of the loop to set the baseline for the output string since we have to have full parity from a length and character account perspective. The two strings should be indentical in length we know for sure. They should also be identical from a composistion perspective as well. That is to say if,, we treated the string and its reverse as sets and we performed the intersection (e.g. A∩B),,,then it should be identical to A and B once we eliminate ordering. At that point we would be validating the set of characters in each string as opposed to ensuring the original order was preserved which is a more exact and stricter approach.
function reverse(input) {