Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 310 Bytes

checking_arrays.md

File metadata and controls

17 lines (11 loc) · 310 Bytes

Checking Arrays

This will always return false because nothing is equal to []

const someArray = []

if (someArray === []) console.log(true)  // false

The way to do this would be to check it's length like so:

const someArray = []

if (someArray.length === 0) console.log(true) // true