samedi 7 avril 2018

Get random variable with javascript

I have multiple local variables containings information about countrires.

let sweden = {
  name: 'Sweden',
  capacity: 120,
  common: ['AX8', 'BLL', 'FAV38']
};
let france = {
  name: 'France',
  capacity: 560,
  common: ['BA', 'BLL', 'EXON']
};

I need to pick a country at random and display the information. How could that be done?

Thank you!




Aucun commentaire:

Enregistrer un commentaire