JAVASCRIPT difficulty


Hi
I am currently learning javascript and I came across this exercise question:
Code
  1. <html>

  2.         <head>

  3.         </head>

  4.         <body>

  5.                 <script language="javascript">

  6.                         var numbers = [-19, -7, -55, 78, 54, 60, -53, 35, 56, 42, 20, 77, 93, -41, -24, -60, 7, 86, 14, -99];

  7.                         alert (secondLargest(numbers));

  8.                         alert (reverse("CSY2028""";

  9.                         }

  10.                 </script>

  11.         </body>

  12. </html>

  13.  
Copyright GeekInterview.com

The scenario is that I have to
Define a function secondLargest() that takes an array and returned the 2nd largest number.
AND
Define a function reverse() that computes the reversal of a string. For example, reverse("Hello world") should return the string "I love Javascript".
I have had done many attempts to solve the task but I run into problems.
Any help? it would be appreciated

Questions by GlennYemoh

Showing Answers 1 - 2 of 2 Answers

Oleg

  • Dec 5th, 2014
 

Here is it.

Code
  1. span style="color: #3366CC;">"""CSY2028"));

  2.  

  Was this answer useful?  Yes

Anshul

  • Jul 1st, 2019
 

Code
  1. span style="color: #3366CC;">"""CSY2028"));

  2.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions