Write a function to find the second largest element in an array. The function takes an array of integers given a string as an argument and returns the second max value from the input array. If there is no second max return -1.
Expand +Tag: react event handling
Passing Arguments to Event Handlers
If you are working on a React function component, you may need to add an event to Click (or other events). Before start this article i will suggest you to read Event Handling in React Element. You usually do:
2 3 4 |
<button onClick={handleClick}>Delete</button> |
…
Expand +