QP School
Check if a variable is an array in JavaScript - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: JavaScript Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=6)
+--- Thread: Check if a variable is an array in JavaScript (/showthread.php?tid=4071)



Check if a variable is an array in JavaScript - Qomplainerz - 04-04-2023

// Check if a variable is an array

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

let isArray = Array.isArray(colors);

document.write(isArray);