js/typescript: get random object in an array

const animals = [
  {sort: 'dog'},
  {sort: 'cat'},
  {sort: 'tiger'}
]

to get a random one animal:

let animal = animals[Math.floor(Math.random() * animals.length)];