QP School

Full Version: Check if a variable is an array in JavaScript
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
// Check if a variable is an array

let colors = ['red', 'green', 'blue'];

let isArray = Array.isArray(colors);

document.write(isArray);