DEV Community

DPC
DPC

Posted on

6 6 6 6 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

AI Agent image

How to Build an AI Agent with Semantic Kernel (and More!)

Join Developer Advocate Luce Carter for a hands-on tutorial on building an AI-powered dinner recommendation agent. Discover how to integrate Microsoft Semantic Kernel, MongoDB Atlas, C#, and OpenAI for ingredient checks and smart restaurant suggestions.

Watch the video β†’

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!

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay