---
title: "Discussion on \"JavaScript Exercises Basic#1 - Finding the smallest value among three numbers\" | Hashnode"
description: "Discussion on \"JavaScript Exercises Basic#1 - Finding the smallest value among three numbers\". Write a function to find the smallest elements among three arguments. (You cannot use sorting methods.)\nSolution\n   function solution(a, b, c){\n\n                /*\n                1. Declare a variable to store minimum element while comparing argumen..."
url: "https://hashnode.com/posts/javascript-exercises-basic1-finding-the-smallest-value-among-three-numbers/62555058b32ddd968bbeb362"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JavaScript Exercises Basic#1 - Finding the smallest value among three numbers](https://reyjang.hashnode.dev/javascript-exercises-basic1-finding-the-smallest-value-among-three-numbers?utm_source=hashnode&utm_medium=feed)

Write a function to find the smallest elements among three arguments. (You cannot use sorting methods.) Solution function solution(a, b, c){ /\* 1. Declare a variable to store minimum element while comparing argumen...

Apr 12, 2022 · 1 min read · reyjang.hashnode.dev  
Updated Apr 19, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Rey Jang](https://hashnode.com/@ReyJang)

@ReyJang

  
[View profile](https://hashnode.com/@ReyJang)

## Responses 1

Markdown supported · ⌘↵ to post

[Marcelo Zárate](https://hashnode.com/@marcelozarate)

[Apr 12, 2022](https://hashnode.com/posts/javascript-exercises-basic1-finding-the-smallest-value-among-three-numbers/62555058b32ddd968bbeb362/comment/6255577db32ddd968bbeb434)

Simple, effective and to the point. Maybe add some kind of validation for the next time? :D

[Rey Jang](https://hashnode.com/@ReyJang)

[Apr 12, 2022](https://hashnode.com/posts/javascript-exercises-basic1-finding-the-smallest-value-among-three-numbers/62555058b32ddd968bbeb362/comment/6255577db32ddd968bbeb434#reply-625563dfb32ddd968bbeb5ed)

Hi thanks for your comment!! I'm fairly new to Javascript and the programming itself so I'm not sure what the validation means here🥺 Do you mean it'd be better if I checked whether the inputs are acceptable first or something like that?

[Marcelo Zárate](https://hashnode.com/@marcelozarate)

[Apr 12, 2022](https://hashnode.com/posts/javascript-exercises-basic1-finding-the-smallest-value-among-three-numbers/62555058b32ddd968bbeb362/comment/6255577db32ddd968bbeb434#reply-625587916386ed96b050cd9a)

[Rey Jang](https://hashnode.com/@ReyJang) Exactly. Just to make it more interesting and less error prone. We all have been new to everything. Keep it up!

[Rey Jang](https://hashnode.com/@ReyJang)

[Apr 12, 2022](https://hashnode.com/posts/javascript-exercises-basic1-finding-the-smallest-value-among-three-numbers/62555058b32ddd968bbeb362/comment/6255577db32ddd968bbeb434#reply-62560fc66386ed96b050d998)

[Marcelo Zárate](https://hashnode.com/@marcelozarate) Ah I see! I'll try to think about that next time. Thank you!!:D
