You can get the number of elements in the array by checking its length property:
const a = [1, 2, 3]
a.length //3
You can get the number of elements in the array by checking its length property:
const a = [1, 2, 3]
a.length //3
Join my AI Workshop!
The Web Development BOOTCAMP cohort starts in February 2026