I think EamonNerbonne's solution is the shortest js one