Question Bank

JavaScript Array and Object Fundamentals Quiz

Difficulty: Easy

Test the day-one moves for working with arrays and objects: type-checking, copying, deduping, and the gotchas hiding under shallow vs deep clones.

Question Bank
/

JavaScript Array and Object Fundamentals Quiz

JavaScript Array and Object Fundamentals Quiz

Test the day-one moves for working with arrays and objects: type-checking, copying, deduping, and the gotchas hiding under shallow vs deep clones.

Question Bank
Easy
JavaScript
5 questions
quiz
arrays
references
fundamentals

759 views

21

Implement a isArr function that returns true for arrays and false for everything else, including array-like objects and typed arrays.

Examples

Example 1:

Input: isArr([1, 2, 3]), isArr('abc'), isArr({ length: 2 }), isArr(new Uint8Array(2))
Output: true, false, false, false
Explanation: Array.isArray returns true only for genuine Array instances; typed arrays and array-like objects fail the check.