Difficulty: 3/10type checking, runtime validation, array detectionThe Array.isArray() method is used to determine whether a given value is an array. It returns true if the value is an array, and false otherwise.Example code:CopyScenario Questions0-2 years experience1You receive a JSON payload where a field might be a single object or an array of objects. How would you use Array.isArray to handle both cases safely?2What does Array.isArray([]) return and why?3If you call Array.isArray on a string value, what result do you get?Follow-up QuestionsWhat edge cases would you test for when using Array.isArray?How does Array.isArray behave with values from different iframes or windows?If you needed to support older browsers without Array.isArray, what fallback would you use?Suggest Improvement