Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
468 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = void 0;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Returns the shortest string in array
|
---|
10 | */
|
---|
11 | const getShortestString = strings => {
|
---|
12 | let shortest = null;
|
---|
13 |
|
---|
14 | for (let string of strings) {
|
---|
15 | if (shortest === null || string.length < shortest.length) {
|
---|
16 | shortest = string;
|
---|
17 | }
|
---|
18 | }
|
---|
19 |
|
---|
20 | return shortest;
|
---|
21 | };
|
---|
22 |
|
---|
23 | var _default = getShortestString;
|
---|
24 | exports.default = _default;
|
---|
25 | module.exports = exports.default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.