0

i just need a yes or a no and possibly a point in the right direction :)

i would like to know how would i be able even do this, chalk is just the same as colors.red, or colors.blue, its just chalk.red or chalk.blue but i would like to make an array that has the different colors that randomize for example, it would be console.log(chalk.arraycolor("this is a test"));

sorry for any problems i will cause, i just need a yes or a no and possibly a point in the right direction :)

this is the code, sorry i could not upload the raw code as its on my raspberry pi

Ben Wall
  • 67
  • 2
  • 9

1 Answers1

1

I think want you want is chalk[rand].

Note that foo["bar"] is the equivalent of foo.bar.

David L. Walsh
  • 24,097
  • 10
  • 61
  • 46
  • thank you for answering my question, i knew it was something simple like that, anyway thanks man :) – Ben Wall Jul 18 '17 at 23:51