DEV Community

DPC
DPC

Posted on

2 2 2 2 1

Daily JavaScript Challenge #JS-152: Find the Second Largest Number in an Array

Daily JavaScript Challenge: Find the Second Largest Number in an Array

Hey fellow developers! 👋 Welcome to today's JavaScript coding challenge. Let's keep those programming skills sharp!

The Challenge

Difficulty: Easy

Topic: Array Manipulation

Description

Given an array of numbers, write a function to find the second largest number in the array. If the array contains less than two unique numbers, return null.

Ready to Begin?

https://www.dpcdev.com/

  1. Fork this challenge
  2. Write your solution
  3. Test it against the provided test cases
  4. Share your approach in the comments below!

Want to Learn More?

Check out the documentation about this topic here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity

Join the Discussion!

  • How did you approach this problem?
  • Did you find any interesting edge cases?
  • What was your biggest learning from this challenge?

Let's learn together! Drop your thoughts and questions in the comments below. 👇


This is part of our Daily JavaScript Challenge series. Follow me for daily programming challenges and let's grow together! 🚀

javascript #programming #coding #dailycodingchallenge #webdev

Top comments (3)

Collapse
 
hbthepencil profile image
HB_the_Pencil

Is the website only JavaScript? Are there other languages?

I don't exactly want to sign up right now 😅 but this challenge looks simple! I don't want to post the solution here (for the sake of people who want to try it), but it gives me hope that I can do some of the other ones :D

Collapse
 
dpc profile image
DPC

Hi! Thanks for your comment!

We are currently working on implementing multiple languages support, in the meantime is only JavaScript. But feel free to try or to share your solution in here! Here can be in any language that you want.

Best regards!

Collapse
 
braingames profile image
Brain Games

cool!