0

I have a string passed through from the previous page which contains a companies name, let's say it's 'Apple'.

On this page I then want to access an object called 'Apple' to get details about it.

I have tried with template literals but doesn't seem to work.

`${companyName}`.map((item)

I'm using reactjs.

thatguy
  • 21
  • 2
  • that other question doesn't help – thatguy May 07 '21 at 12:29
  • It goes in good depth in how you'd get the result you want. It's also exactly the same thing you asked - you have a string, you want the variable with the same name. If it doesn't help, then you seem to have asked a different question but worded it the same as that one. Without knowing *what* is different, there is no way to know what the correct answer would be. – VLAZ May 07 '21 at 12:38
  • I got the answer I needed elsewhere in the end. – thatguy May 07 '21 at 14:31

0 Answers0