Periksa apakah instance adalah array

Method 1: Using the isArray method
Array.isArray(variableName)'

Method 2:
variable instanceof Array

Method 3:
variable.constructor === Array
Samiksha Singla