Incorporate package superheroes in my node

  Kiến thức lập trình

I really tried incorporte it in my project, but show me error by random. Anybody can help me what is wrong? This is my error code:

import superheroes from  "superheroes"
const mySuperHeroName = superheroes.random()
console.log(`I am ${mySuperHeroName} !`)


//const mySuperHeroName = superheroes.random()
                                       ↑
   by terminal          TypeError   superheores.random() is not a function

I’ve already installed the package and changed the type to module.

Show me in terminal error about superheroes.random() say this “random” is not a function.

New contributor

Ezequiel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT