--- title: Closest-pair problem id: 5951a53863c8a34f02bf1bdc challengeType: 5 videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert(typeof getClosestPair === "function", "getClosestPair is a function.");' - text: '' testString: 'assert.equal(getClosestPair(points1).distance, answer1.distance, "Distance should be the following.");' - text: '' testString: 'assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points1))).pair, answer1.pair, "Points should be the following.");' - text: '' testString: 'assert.equal(getClosestPair(points2).distance, answer2.distance, "Distance should be the following.");' - text: '' testString: 'assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points2))).pair, answer2.pair, "Points should be the following.");' ```
## Challenge Seed
```js const Point = function (x, y) { this.x = x; this.y = y; }; Point.prototype.getX = function () { return this.x; }; Point.prototype.getY = function () { return this.y; }; function getClosestPair (pointsArr) { // Good luck! return true; } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```