How to count the number of Strings in localStorage and not the number of characters in it

const ids = ['1','2','3'] // user ids

//set the ids inside local storage

localStorage.setItem('id', JSON.stringify(ids))

//get the ids back from local storage

if('id' in localStorage){
  const ids = JSON.parse(localStorage.getItem('id'))
  console.log(`total ids in local storage ${ids.length}`)
}