Here we will talk about how to use JavaScript properly To show off position and value of the largest string in an array, based on the length of string that is used.
javascript
let arr = ['apple', 'banana', 'strawberry', 'kiwi','pineapple'];
let largestString = arr. (y, x) => y.length > x.length? a : b);
let position = arr. indexOf(largestString);
console. log(Position: ${position}, Value: ${largestString})
In this case the output will be aware of this array: []
Rank: 2, Fruit: strawberry