Javascript Question

Is there anyway to know specific type of javascript variable

I have variable

data
below

var data = [
{
id: 1,
name: "John",
sex: "M",
maritalStatus: "M",
dob:"01-01-1990",
title:"Software Engineer",
address:"VN",
phoneNumber:"(123) 456-7890",
email: "john@gmail.com"
}
];

var data = [
["1", "John", "M", "M", "1990", "Software Engineer", "john@gmail.com", "(123) 456-7890"],
];


Is there anyway to know their type.I'm using
typeof(data)
but both show it's object.

Answer

Array.isArray(data) will return true since data is an array.

EDIT:

After clarification in the comments of this answer, Array.isArray(data[0]) will check if the first element in the array data is an array.