Check if object is an array

 Problem

I have an object and want to check if it's an Array object.



 Recipe


// Initialize the array

let arr = [1,2,3]

// Check if 'arr' is an Array

if arr is Array {
    print("Yes, it's an Array")
}

				


 Playground