[Question]
  [
Your challenge is to take an array of strings and output the longest string in the array. So for
```
["tiny", "small", "bigger", "biggest"]
```
the output would be `biggest`.
If two elements of the array have the same length, you should choose the one that appears first in the array. That means if the array looks like this:
```
["one", "two", "no"]
```
the output is `one`, but if the array looked like this:
```
["two", "one", "no"]
```
the output is `two`.
---
As this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), the shortest code in bytes wins.
  
[Answer]
# [Imperative Tampio](https://github.com/fergusq/tampio), 168 bytes
```
Listan x on riippuen siitä,onko sen ensimmäisen alkion pituus suurempi tai yhtä suuri kuin sen jokaisen alkion pituus,joko sen ensimmäinen alkio tai sen hännän x.
```
[Online version](http://iikka.kapsi.fi/tampio/pisin-golf.html)
Ungolfed:
> 
> Listan pisin alkio **on** **riippuen** **siitä**, **onko** sen `ensimmäisen` alkion pituus **suurempi** **tai** **yhtä** **suuri** **kuin** sen **jokaisen** alkion pituus, **joko**
> 
> 
> * sen `ensimmäinen` alkio **tai**
> * sen hännän pisin alkio.
> 
> 
> 
[Online version](http://iikka.kapsi.fi/tampio/pisin.html)
The only golfing opportunity this has is to replace `pisin alkio` (meaning "the longest element") with `x`.
Translation:
> 
> The longest item in a list is, depending on whether the length of the first item is greater or equal to the length of each element in the list, either
> 
> 
> * the first item in the list, or
> * the longest item in the tail of the list.
> 
> 
> 
[Answer]
# [Python](https://docs.python.org/), 23 bytes
```
lambda a:max(a,key=len)
```
[Try it online!](https://tio.run/##xVRNk5swDL33V2RyIZnJaY@d2V/S9CBAAS/G8vgjlP751LYEgc3O9NTpBQF@enqWnm3n0JN5e9zerw8NY93CAb6P8OsElwHnd43m/LBOmXC6nX4csY3ueDkShfQM0Ifjz/P527pe5fXqcqgSIIeMyNEr@ZpyRKtsjo4CqBZKAuRHH1QBRJpzGJp4y1Fr/l1IWiNQxELtBBwicQ6MPr8YaNacjtovaDFArTQWGDrYIBbZ6GLhwgHGlUwwi1Y0TB6wWyEGeaOBqxvlAPv8OsKK8R528rEubD6ybhwldVVb1sO1knrkuULvP9VgYKlBv1Xf@LW947VS2@1NZIbtrlG/dNso6KTfkYok5Fyj/jaooaGyk07VLwMG14G685iYz2HrgPVPW42GVDDcDLEUmepwqfCucRKPlXZqDaWON9yZpbGvBVKvrCXHUwPpey/k3VOCdJh/JaDfbv8pr/dRLETLzPqEdoXXkr59UWcxlGhMKEbjDuWVoP2SpjsDLvhnN1Kx2bF0Hz8@W8zh6p7/SKHTsXdgdhxyin06rrUdY5mLRy0XhMPkpEESDFj42PVOaSmqFUyc2TeBbTZ7H@2ulAxQ7VyCnQO9gxkS0uDxzu42pBMxsiJr41bEyKfQkXN8D8kCLcuNZhfxPrNdveMrSm4KRs51TfolnyUnsSVZDuY/gKbL@/EH "Python 2 – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 35 bytes
*-3 bytes thanks to Zgarb.*
```
foldl1(!)
a!b|(a<$a)<(a<$b)=b|1<2=a
```
[Try it online!](https://tio.run/##FcUxEkAwEADA3itOJoXMUFAnL0FxIcE4kiE6b3dodmc8V0fE3nTsA41UF7nKMLd3gVqi0n9WGXvXujHIGy47GIjHsieQ4KEVbrwOUYoQ0mfCOYmen8ETTidXQ4wv "Haskell – Try It Online")
I like this code. You know why? Because Haskell supports much more elegant solutions with functions from random libraries.
```
maximumBy(compare`on`length).reverse
```
That's friggin' readable! Except, it's not valid.
```
import Data.List
import Data.Function
maximumBy(compare`on`length).reverse
```
If it weren't for the imports, this would've been a perfect submission to get all the upvotes. :P
(Also, this uses one golfing tip *and* it uses a fold.)
[Answer]
# [R + pryr](https://cran.r-project.org/web/packages/pryr/index.html), 31 bytes
[-2 bytes thanks to Scrooble]
```
pryr::f(x[order(-nchar(x))][1])
```
[Try it online!](https://tio.run/##fVLBbsIwDL3vKxAXWqk77IrElyA0mdRtItq4chIK@/kuTkIZHHZoHcXPz8/P4QU2h42qttgG3jZbIh//HrQEZ/J5jgEnM8XA5MG0IFCIn/ZGkoHu8X9RoYthGNKd1LY2gxCFjjPMB0pgGF2MFlQBNz2171zo4WwGFAgyrNmiDzkIBV5gLBw5XVShTYQe@5K1mEbxcu6tYUAdTyOUtHPwRyWehcKFpK/BMdc8dEnS73IDcolUuxdar40zzmtUxIzKU/BT8I9a6Uc/RitXnBx35jnYTPbyHBaHV1etgT77GkhkYaqx5p9FXBTJGL05vy4OuAdzTWtIJKvomcn2WfL3t7iCLYOMhfNTpiXjbXImvxqyyarrgHN@RWLqMIA0dTbZVNwt7VbWaNs0Ead1QXY@66H@0TOVN/kiYtxz8FWMdiG/FCrb0hHIwjbR0L1zl2eTBTURkYC4IuqP7rBMfOf9vqtux6gOufq0SgNXt7o@Hb9O9aLAV10Fdb38Ag "R – Try It Online")
---
# [R](https://www.r-project.org/), 33 bytes
```
function(x)x[order(-nchar(x))][1]
```
[Try it online!](https://tio.run/##vVRBctswDLz3FRlfYs@ohz4gL8nkAEmQyJgiNCBpx/28CwJ0LPvQU6cHizK5WCyWgPgKL28vw36HY@FdtyPK8szg6pK8vZ9lwdWvsjBl8CNUKMjPZV8PC13keRzKJEsIuldjx2ggxErHBsuFFAxLkjXC0MDdTOMzF2bofcAKQYbv06YPuVQKPMLSOOy4qcKohBnndhpRS8n1fY6eAZ28LdCOU4KNSuwrRSqqr8PFYm666mF@tQSUlNSlB1qFVFr67d2QmmHLq7/rP1M83mvC8Ghe9DCbfYVqdtSY6P/i93Ggqnb2/eP9AM/gT@q2kjCODCryfFcTyeeodVoPUNTCTwHP1hPVohCgcqeoRTevnlnFhHUlVvPBfHRGOd9yanhnG4JJ9/q@xbhU7N6pee8EyJVtpTA9c7cmMEGdIBSIG0TyBkwtIMwROKdbvZLgwqoylc@HtmC83fr/DA0ydwxxE2vT1CUZnX5ditM/GGw@GaUPjoaOsMLnxhkfLFPwUKFCN2RtkUtKZd1ksPvwm4vGmSFsEJGMKic8aStGCkKHqmBdyz3rorPBxKzDb7vUjoagXaAtVTsssX4UbFQVdOl7Co9xKk501SCbln8FOvyY3q5TiWILxf3X4etduhd5/zMODlg2Dh/vvz6uA@T9tIfD4foH "R – Try It Online")
[Answer]
# EXCEL, ~~36~~ 42 bytes
```
=INDEX(A:A,MATCH(MAX(LEN(A:A)),LEN(A:A),))
```
Entered as an array formula (ctrl-shift-enter). The input array should be entered in column A.
The formula returns the first match with maximum length.
Depending on your region settings, substitute `,` with `;`; the code length remains unchanged.
Of the 16 languages listed [here](http://dolf.trieschnigg.nl/excel/index.php), English function names are the shortest for this formula.
Explanation:
```
=                                          - return
 INDEX(                                  ) - the item of
       A:A                                 - the input
          ,                                - at
           MATCH(                       )  - the position of
                                       ,   - the first exact match of
                 MAX(        )             - the maximum of
                     LEN(   )              - the array of lengths of
                         A:A               - the input
                              ,            - in
                               LEN(   )    - the array of lengths of
                                   A:A     - the input
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 9 bytesSBCS
```
⊢⊃⍨∘⊃∘⍒≢¨
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24RHXYsedTU/6l3xqGMGiAEkeyc96lx0aAVQXkG9JDOvUl1BvTg3MScHSCdlpqenFgEZOfl56anFJeoA "APL (Dyalog Unicode) – Try It Online")
`⊢` from the argument,
`⊃⍨` pick the element with the index which is the
`⊃` first of the
`⍒` indices in descending order of the
`≢¨` lengths of each
[Answer]
# [Prolog (SWI)](http://www.swi-prolog.org), ~~98~~ ~~92~~ ~~72~~ 69 bytes
The top level predicate is `*`.
```
X/Y:-atom_length(X,Y).
[A]*A.
[A,B|L]*Z:-A/X,B/Y,Y>X,[B|L]*Z;[A|L]*Z.
```
[Try it online!](https://tio.run/##KyjKz8lP1y0uz/z/P0I/0ko3sSQ/Nz4nNS@9JEMjQidSU48r2jFWyxFE6TjV@MRqRVnpOupH6DjpR@pE2kXoREMEraMdwbTe///Riek6hSmlRTr5@SU6JYkZJbFaEXoA "Prolog (SWI) – Try It Online")
**Explanation**
The first row defines the dyadic predicate `/` to be a short for `atom_length/2`which is true if the first argument's length is the second argument. This saves us 3 bytes over using `atom_length` twice.
Our main predicate is defined as the dyadic `*` where the first argument is a list and the second argument the longest element of that list.
The second row is our base case which states that the longest element of a one element list is that element.
The third row states that for a list with at least 2 elements, the longest element is:
If the length of the second element is longer than the first element, the longest element is in the list without the first element.
Otherwise the longest element is in the list without the second element.
[Answer]
# [Pyth](https://pyth.readthedocs.io), 4 bytes
```
h.Ml
```
**[Test suite.](https://pyth.herokuapp.com/?code=h.Ml&test_suite=1&test_suite_input=%5B%22tiny%22%2C+%22small%22%2C+%22bigger%22%2C+%22longest%22%5D%0A%5B%22edur%22%2C%22oot%22%2C%22taht%22%5D&debug=0)**
Explanation
```
h.Ml   | Program
h.MlZQ | With implicit variables filled in
-------+--------------------------------------------------------------------
h      | First element of
 .M  Q | The list of elements from the input list with the maximal value for
   lZ  | The length of the element
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 24 bytes
```
($args[0]|sort l* -d)[0]
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/X0MlsSi9ONogtqY4v6hEIUdLQTdFE8j9//@/g4ZSUmZ6empxiZKOglJJZl4liC7OTczJATHAckUgVk5@HkxVYk5xfk5eupImAA "PowerShell – Try It Online")
Takes input `$args[0]`, pipes that to `Sort-Object` based on `l`ength in `-d`escending order. Then takes the `[0]`th one thereof. Since sort is stable, this takes the first element in case of a tie.
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 33 bytes
```
@(x)x{[~,p]=max(cellfun(@nnz,x))}
```
Input is a cell array of strings.
[**Try it online!**](https://tio.run/##y08uSSxL/Z9mq6en999Bo0Kzojq6Tqcg1jY3sUIjOTUnJ600T8MhL69Kp0JTs/Z/mka1UklmXqWSjoJScW5iTg6IkZSZnp5aBGLl5OelpxaXKNVqcoFUpqaUAoWV8vNLgGRJYgZI4j8A "Octave – Try It Online")
### Explanation
`cellfun(@nnz,x)` applies the `nnz` function (number of nonzeros) to each string in the input array `x`. For ASCII strings, `nnz` is equivalent to `numel` (number of elements), but shorter. The result is a numeric array with the string lengths.
Then, `[~,]=max(...)` gives the index of the first maximum in the array of string lengths. The result is used as a curly-brace index into `x` to obtain the corresponding string.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org/en/), 38 bytes
[Try it online!](https://tio.run/##LcdNCoAgEEDhq7RTwaQDZBeJFqON/SBO6FTHN4Q2j/ed8EDx@bi4T7RijchdsBXsBKZQZilBO9UUMW28j@4fNQ9L9ZQKRTSRNhnkLCih0IJfat0zNgW6s1iUqh8)
```
a=>a.sort((a,b)=>a.length<b.length)[0]
```
[Answer]
# [J](http://jsoftware.com/), 19, 11, 10 8 bytes
```
0{>\:#@>
```
[Try it online!](https://tio.run/##vVTLjtswDLznK4z2IBRYLPbRXmLsYj@kF9pmbCWyZOgRIy367SlFKrGTw56KHmQJ4nA4pEjvz/3btnqqaJ2ffr//3H79eD9/23x5rNTu7VFVD9WfbdVvNtgOrtpVCpq2U7V6ef3@g7ZnWjP6OMzB0xGW4/PLq7o6YZfynXORvhGG@JmpVkHLeaYNJz3R5l0E3QEHoTVEnY3Jneh7aNOONmP4Lvt2VkCImc4LLCbHYBgD7RbaAq57191zYYRGG8wQ9HC1Fn3oU6bAA4yFQ8xFFVomjNgXq0VOJeZzb7UHHOg0QjGHACuV2GSKkFhfjaP4XHRlY1RKIrjArEO44WVM5nW/9NCGUrFRKb1kMDt7WLJCc1s@q6GXAiaX4yP7WP1JxQ@ty3p73dy@EPge9JHrzSQeOw@scl7UWKej5UylC5zl1I8GZ@mKXCRjIHMHy1mXat2zUhWmyXkuP0glB6HsLzHZvZYLwoQlv6uYISR5eVeqPxDQZ7bJmd09d2kDEVQTgoG4QgQtwFAcTG/Bx3DJlwKcPKsMaX/TGB4v7/4/XQ1Nnge78pV5egg0PM00plzpOqCRCfVIfXAQtIUJ9qvKaCORjIYMJbo2coucQkjTKoK8h149NPYezAphnVDFgEduResM0SErmKa0RB15OLzznsdfbl0xtYa7gFsqd1jw/FuQYWXQqWmcufVjcaQrO8m0/CvQ5vwX "J – Try It Online")
Thanks to streetster for the hint!
-1 byte thanks to FrownyFrog!
-2 bytes thanks to Conor O'Brien 
## How it works:
```
    (  #@>) - unbox each string and find its length
     \:     - sort down the list of strings according to the lengths
0{::        - take and unbox the first string
```
[Try it online!](https://tio.run/##vVTLjtswDLznK4z2oC6wWOyjvcTYoh/SC20zthJZMvSIkRb99pQildjJYU9FD7IEcTgcUqT35/59Wz1XtM7Pv7fbLz@3n398fzg/bD49VWr3/qSqx@rPtuo3G2wHV@0qBU3bqVq9vn39RtsLrRl9HObg6QjL8eX1TV2dsEv5zrlI3whD/MhUq6DlPNOGk55o8y6C7oCD0BqizsbkTvQ9tGlHmzF8l307KyDETOcFFpNjMIyBdgttAde96@65MEKjDWYIerhaiz70KVPgAcbCIeaiCi0TRuyL1SKnEvO5t9oDDnQaoZhDgJVKbDJFSKyvxlF8LrqyMSolEVxg1iHc8DIm87pfemhDqdiolF4ymJ09LFmhuS2f1dBLAZPL8ZF9rP6g4ofWZb29bm5fCHwP@sj1ZhKPnQdWOS9qrNPRcqbSBc5y6keDs3RFLpIxkLmD5axLte5ZqQrT5DyXH6SSg1D2l5jsXssFYcKS31XMEJK8vCvVHwjoM9vkzO6eu7SBCKoJwUBcIYIWYCgOprfgY7jkSwFOnlWGtL9pDI@Xd/@froYmz4Nd@co8PQYanmYaU650HdDIhHqkPjgI2sIE@1VltJFIRkOGEl0buUVOIaRpFUHeQ68eGnsPZoWwTqhiwCO3onWG6JAVTFNaoo48HN55z@Mvt66YWsNdwC2VOyx4/i3IsDLo1DTO3PqxONKVnWRa/hVoc/4L "J – Try It Online")
[Answer]
# C#, 43 + 18 = 61 bytes
[Try it online!](https://tio.run/##TY7BCsIwEETv@YqlpwQ0P1Dbg4onRcGDB/EQ0lUDdYPZ1Fak315jRXAuuzMDb9fy1PqAQ8OOLrB/csRbLv6dXju650LY2jDDTrwEJHE00Vl4eFfBxjiSaoy/5UerhuyMY0ig42kC362Ec4qhgMEUpdHbUGGYP5fIFqlKveyKstNrpEu8Kr1ygaNUQzr@oy48sa9RH4KLmB5D@QFKwvZ4ghdknjCbQBZbP45rGO3ZNyGDXql8BPWiF8Mb)
```
a=>a.OrderByDescending(x=>x.Length).First()
```
[Answer]
# [Perl 6](https://perl6.org), ~~14~~ 13 bytes
```
*.max(*.chars)
```
[Try it](https://tio.run/##K0gtyjH7X1qcqlBmppdszZVbqaCWk5@XnlpcolueX5SiYPtfSy83sUJDSy85I7GoWPO/NVdxYqUCippopZLMvEolHQWl4tzEnBwQIykzPT21CMSCqlSKxaoxNaUUqEopP78ESJYkZoDU/QcA "Perl 6 – Try It Online")
```
*.max(&chars)
```
[Try it](https://tio.run/##K0gtyjH7X1qcqlBmppdszZVbqaCWk5@XnlpcolueX5SiYPtfSy83sUJDLTkjsahY8781V3FipQKKkmilksy8SiUdBaXi3MScHBAjKTM9PbUIxIKqVIrFqjE1pRSoSik/vwRIliRmgNT9BwA "Perl 6 – Try It Online")
[Answer]
# PHP, 72 bytes
```
array_reduce($a,function($c,$i){return (strlen($i)>strlen($c))?$i:$c;});
```
[Answer]
# Japt `-h`, ~~5~~ 3 bytes
```
ÔñÊ
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=1PHK&input=WyJlZHVyIiwib290IiwidGFodCJdCi1o)
Reverse, sort by length and output the last element.
[Answer]
# [Swift](https://swift.org), 54 bytes
```
{($0 as[String]).reduce(""){$1.count>$0.count ?$1:$0}}
```
[Try it online!](https://tio.run/##Ky7PTCsx@V@WWKSQpmD7v1pDxUAhsTg6uKQoMy89VlOvKDWlNDlVQ0lJs1rFUC85vzSvxE7FAMJQsFcxtFIxqK39XwBUXaKRphGtBFRepKSjlJ9fAiRLEjNKlGI1Nf8DAA)
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 9 bytes
```
*x@>#:'x:
```
[Try it online!](https://tio.run/##y9bNz/7/X6vCwU7ZSr3CSkMpIzUnJ1/JWqkkI7UoFUgn56eAqPT8nLTUomIgqzw1Jzk/FyRWAlKXWwkkEvOKy1OLlDT//wcA "K (oK) – Try It Online")
**Example:**
```
*x@>#:'x:("edur";"oot";"taht")
"edur"
```
**Explanation**
```
*x@>#:'x: / solution
       x: / store input in variable x
    #:'   / count (#:) each (')
   >      / sort descending
 x@       / apply indices to x
*         / take the first one
```
**Notes:**
Undeleted as this is classed as non-trivial, despite being basically 5 steps (would be if written as the function `{*x@>#:'x}`).
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 67 bytes
Another submission in my favourite language! (read: the only one I know).  
This doesn't work with an empty array, but that's fine.
Golfed
```
w->{for(String y:w)if(y.length()>w[0].length())w[0]=y;return w[0];}
```
Ungolfed
```
for(String y:w)                           // Loops through all Strings
    if(y.length()>w[0].length())          // If the String is longer than the first String 
                                w[0]=y;   // Store it as the first string.
return w[0];                              // Return the first String.
```
[Try it online!](https://tio.run/##RY2xDsIgEEBn@IqLEySVONvoH@jiaBywpYgiNHC1aZp@O0LUON295O69u3zJte@Vu7eP1FgZIxykcTMlxqEKnWwUHGcKhJwwGKdBs89yvsDIa0oWSkk/XK1pIKLEPF7etPDMkv@l5FlI/hh0hB3I8@YiYm8NslW1KjJymiKqp/ADij4fo3XMCc3KA//VvpkjuOxI43o/dz58WzBtR246NgmrnMYb4/uxVH7EC@2mOigcgoNC9ZJITZeUVDuEynusUN7wDQ "Java (OpenJDK 8) – Try It Online")
[Answer]
# [Racket](https://racket-lang.org/), 160 bytes 110 bytes
[Try it online!](https://tio.run/##K0pMzk4t@f9fOScxL12hCMzj4tJISU3LzEvVyFVI1NTITNOw08hJzUsvyQByDSECthrFJUWZeem6EAmN5MQioKQmmmiuRnIKWBwoA1GBJATTowm0L1dBXUPJPy9VSUEppDwfSLrllxaBqMyyVCWgCriCVMJKsCkoBqr4/x8A "Racket – Try It Online") 
First time contributing, advice appreciated!
```
(define(m a)(if(>(length a)1)(if(>=(string-length(car a))(string-length(m(cdr a))))(car a)(m(cdr a)))(car a)))
```
**Ungolfed**
```
(define (m a)
    (if (> (length a) 1)
        (if (>= (string-length (car a)) (string-length (m (cdr a))))
            (car a)
            (m (cdr a))
        )
        (car a)
    )
)
```
Updated solution based on feedback
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 45 bytes
```
a=;for b;do((${#b}>${#a}))&&a=$b;done;echo $a
```
[Try it online!](https://tio.run/##S0oszvj/P9HWOi2/SCHJOiVfQ0OlWjmp1g5IJtZqaqqpJdqqgMTzUq1TkzPyFVQS////X5KZV/m/ODcxJ@d/UmZ6emoRhCouAQA "Bash – Try It Online")
[Answer]
# [Scratch](https://scratch.mit.edu) 27 17 170 160
[![the code picture](https://i.stack.imgur.com/PrL1n.png)](https://i.stack.imgur.com/PrL1n.png)
It expects a global (attached to all sprites, to be more precise) list of strings called `mylist`. After clicking the green flag, the longest word will be left in the variable `w`.
I think [this is the link](https://scratch.mit.edu/projects/195018504/)
```
when gf clicked
set[w]to(item[1]of[mylist
set[i]to[0
repeat(length of[mylist
change[i]by(1
set[m]to(item(i)of[mylist
if<(m)>(w)>then
set[w]to(m
end
end
stop[all
```
Counting as per [this meta.](https://codegolf.meta.stackexchange.com/questions/673/golfing-in-scratch/5013#5013)
[Answer]
# [Röda](https://github.com/fergusq/roda), 30 bytes
```
{enum|[[#_,-_,_1]]|max|_|tail}
```
[Try it online!](https://tio.run/##K8pPSfyf9r86Na80tyY6WjleRzdeJ94wNrYmN7GiJr6mJDEzp/Z/bmJmnkI1F2e0UmpKaZGSjlJ@fgmQLEnMKFGKVahRSOOq/Q8A "Röda – Try It Online")
Explanation:
```
{
 enum|         /* For each element, push its index to the stream */
 [[#_,-_,_1]]| /* For each element and index, push [length, -index, element] */
 max|          /* Find the greatest element */
 _|            /* Flat the list in the stream */
 tail          /* Return the last item in the stream */
}
```
Alternative 30 bytes:
```
{enum|[[#_,-_,_1]]|max|[_[2]]}
```
[Try it online!](https://tio.run/##K8pPSfyf9r86Na80tyY6WjleRzdeJ94wNrYmN7GiJjo@2ig2tvZ/bmJmnkI1F2e0UmpKaZGSjlJ@fgmQLEnMKFGKVahRSOOq/Q8A "Röda – Try It Online")
[Answer]
# APL -- ~~23~~ 16 bytes
~~`a←{((⍴¨⍵)⍳(⌈/(⍴¨⍵)))⌷⍵}`~~
Thanks to everyone for all of your great suggestions and encouragement!
```
a←{⍵⌷⍨(⍴¨⍵)⍳⌈/⍴¨⍵}
```
### Usage:
```
a 'duck' 'duck' 'goose'
  'goose'
```
### Explanation:
gets length of each vector of characters (string) then uses maximum as an index. I just started APL 20 min ago so I am sorry if this is a stupid way to do it. 
[Try it Online!](http://tryapl.org/)
*(edited for clarity)*
[Answer]
# [Standard ML (MLton)](http://www.mlton.org/), 55 bytes
```
fun&(s::r)=foldl(fn(%,$)=>if size% >size$then%else$)s r
```
[Try it online!](https://tio.run/##FcVRCoUgEADAqyyioVAXCOwij0cErSRsa7hbH13e6mdGdhp20sKtpZM7L@NYQ0yFVvKJvettiFNOIPlGB9OX1Q3ZIQnaIFDbtRDMEOGomRV8Bz@D61lNb0rRV102Nf/QHg "Standard ML (MLton) – Try It Online") Example usage: `& ["abc","de","fgh"]` yields `"abc"`.
### Ungolfed:
```
fun step (current, longest) = 
    if size current > size longest 
    then current 
    else longest
fun longestString (start :: list) = foldl step start list
  | longestString nil = raise Empty
```
[Try it online!](https://tio.run/##XY5BCsJADEX3PUWYVQv1AgXdeQKXIjLYtB1IM2UmLSjefUydUtAsAvn/JT9xpMNI4jmlbmaIghOUjzkEZKmBPPcYpYIjFKDlOojuhbABcMrjhmVGBuQd@CpIcWeKYo3ZhosExz2UUWwQaBogl8M6Ty3lZ7K3Gnrr/bfJjpQO1mnAeZzkmRZLcFdtUl@g/MWvBts5mNp4L9rFDmJuVfoA "Standard ML (MLton) – Try It Online")
[Answer]
# [Julia 0.6](http://julialang.org/), 24 bytes
```
!s=s[indmax(length.(s))]
```
[Try it online!](https://tio.run/##TcaxCoAgEADQX0knhQhqaOtLxMFI7OK8wrugvt5w603vuBHCXKvihR3QlsNjMFKSfTBsra9XARIko5wWoFf3neYcEFtWSCmWNjwpRZbx90l7Wz8 "Julia 0.6 – Try It Online")
[Answer]
# [Funky](https://github.com/TehFlaminTaco/Funky), 38 bytes
```
a=>a[(v=a::map@#)::find(math.max...v)]
```
## Explained
```
a=>a[(v=a::map@#)::find(math.max...v)]
        a::map@#                        $ Create a list of the lengths of the input's strings.
      v=                                $ And assign it to v.
     (          )::find(            )   $ Find the first index in this list that equals...
                        math.max...v    $ The largest value of v, eg. the length of the longest string.
   a[                                ]  $ Get the value at that position.
```
[Try it online!](https://tio.run/##SyvNy678n2b7P9HWLjFao8w20coqN7HAQVnTyiotMy9FIzexJEMvN7FCT0@vTDP2f0FRZl6JRppGtVJiUrKSjlJKalo6kDIE4oz8vGylWk3N/wA "Funky – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~21~~ 20 bytes
```
->s{s.max_by &:size}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1664ulgvN7EiPqlSQc2qOLMqtfZ/QWlJsUJadLRSfl6qko5SSXk@iMwoSk1Vio3lgsuW5oHEU/KLQbJFqcUokqmZeSDxqvLUTJCiIiAVG/sfAA "Ruby – Try It Online")
Trivial solution, thanks Snack for -1 byte
[Answer]
# Perl, 24 bytes
Includes `+1` for `p`
Give words as lines on STDIN
```
perl -pe '$;[y///c]//=$_}{$_=pop@'
one
two 
no
^D
```
[Answer]
# [SNOBOL4 (CSNOBOL4)](http://www.snobol4.org/csnobol4/), ~~63~~ 57 bytes
```
I	M =LT(SIZE(M),SIZE(X)) X
	X =INPUT	:S(I)
	OUTPUT =M
END
```
[Try it online!](https://tio.run/##K87LT8rPMfn/35PTV8HWJ0Qj2DPKVcNXUwdMR2hqKkRwcUYo2Hr6BYSGcFoFa3hqcnH6h4YAeQq2vlyufi7//5eU53Pl56Vy5eUDAA "SNOBOL4 (CSNOBOL4) – Try It Online")
Input is on stdin and output on stdout.
Roughly translates to the following pseudocode:
```
while input exists
 x = input
 if length(m) < length(x)
  m = x
end
return m
```
]