src/rover.js
/**
   *Rotates a rover 90 degrees left or right
   *
   * @param {number} direction 1 for 90 degrees, -1 for -90 degrees
   * @memberof Rover
   */
Rotates a rover 90 degrees left or right
@param {number} direction 1 for 90 degrees, -1 for -90 degrees
@memberof Rover
Rotates a rover 90 degrees left or right @param { number } direction 1 for 90 degrees - 1 for - 90 degrees @memberof Rover
rotate (direction) {
    if (!Number.isInteger(direction)) {
      throw new Error('integer direction to rotate is required')
    }
    if (direction < -1 || direction > 1) {
      throw new Error('direction must be -1 or 1 (left or right)')
    }
    this.direction = (this.direction + direction + 4) % 4
  }
rotate ( direction ) { if ( ! Number . isInteger ( direction ) ) { throw new Error ( 'integer direction to rotate is required' ) } if ( direction < - 1 || direction > 1 ) { throw new Error ( 'direction must be -1 or 1 (left or right)' ) } this . direction = ( this . direction + direction + 4 ) % 4 }
Rotates a rover 90 degrees left or right
 @param {number} direction 1 for 90 degrees, -1 for -90 degrees
 @memberof Rover
Rotates a rover 90 degrees left or right @param { number } direction 1 for 90 degrees - 1 for - 90 degrees @memberof Rover