Check if array is empty | JavaScript

April 25th, 2021 08:52:46 PM

					
arr = [] // empty array const isEmpty = arr => !Array.isArray(arr) || arr.length === 0; // Examples isEmpty([]); // true isEmpty([1, 2, 3]); // false

Featured Posts