問題文
A utility must branch when its argument is an array rather than a plain object. Which check identifies an array correctly?
選択肢
- Array.isArray(value), which returns true only for arrays and works across execution contexts.
- value.length !== undefined, which is true for every array and false for other values.
- value instanceof Object, which is true for arrays and false for plain objects created with the object literal syntax.
- typeof value === 'array', which distinguishes arrays from objects, and the specification defines a dedicated result string for the array type.