DEV Community

DPC
DPC

Posted on

5 5 6 5 4

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

$150K MiniMax AI Agent Challenge — Build Smarter, Remix Bolder, Win Bigger!

Join the MiniMax AI Agent Challenge — Build your first AI Agent 🤖

Developers, innovators, and AI tinkerers, build your AI Agent and win $150,000 in cash. 💰

Read more →

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!

The Community for IaC Practitioners

The Community for IaC Practitioners

Join IaCConf on August 27 for a virtual event that dives into the security and governance challenges of managing infrastructure as code at scale.

Register Now

👋 Kindness is contagious

Explore this insightful piece, celebrated by the caring DEV Community. Programmers from all walks of life are invited to contribute and expand our shared wisdom.

A simple "thank you" can make someone’s day—leave your kudos in the comments below!

On DEV, spreading knowledge paves the way and fortifies our camaraderie. Found this helpful? A brief note of appreciation to the author truly matters.

Let’s Go!