---
title: "Discussion on \"Array Question\" | Hashnode"
description: "Discussion on \"Array Question\". Q1.Span Of Array\nhere we need to find the diffrenct between max and min\nwe have 2 ways\n1)sort the array\n2)with the help of for loop\n\nlet data = [12,23,232,14];\n\ndata.sort(function (a,b) {return a-b})\nlet diff = data[data.length-1] - data[0];\nconsole...."
url: "https://hashnode.com/posts/array-question/663e64de0ff30708b31703bc"
---

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

Discussion

# [Array Question](https://devbunney.hashnode.dev/array-question?utm_source=hashnode&utm_medium=feed)

Q1.Span Of Array here we need to find the diffrenct between max and min we have 2 ways 1)sort the array 2)with the help of for loop let data = \[12,23,232,14\]; data.sort(function (a,b) {return a-b}) let diff = data\[data.length-1\] - data\[0\]; console....

May 10, 2024 · 2 min read · devbunney.hashnode.dev  
Read the article

## Written by

[Biplav Mazumdar](https://hashnode.com/@DevBee)

@DevBee

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

Dev

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
