Array Prototype Reduce Javascript Toggle