Difficulty: 4/10Array reduction, Memory limits, Performance optimizationExample code:CopyScenario Questions0-2 years experience1We are building a simple dashboard widget that displays the lowest and highest temperature recorded today from an array of hourly readings. How would you write a function to extract these two values? What should your code return if the sensor data array is empty?2A colleague used `Math.min(...temperatures)` and `Math.max(...temperatures)` to find the range of a dataset. It works fine in local testing, but what might go wrong with this approach if the dataset grows to tens of thousands of items, and how would you write a safer alternative?Follow-up QuestionsWhat is the maximum array size your solution can handle before hitting engine-specific memory or call stack limits?How would you modify your approach if the array was a stream of numbers arriving over a WebSocket rather than a static in-memory array?If the array contains NaN or undefined values, how does your current implementation behave, and how would you make it resilient?Suggest Improvement