79077153

Date: 2024-10-11 07:25:49
Score: 1
Natty:
Report link

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

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: brainscollege