1

I wouldike to know how can I convert variable from my env file :

.env :

ID=10 

.js :

export const injectedConnector = new InjectedConnector({ supportedChainIds: [1, process.env["ID"];], }); 
3
  • 1
    parseInt(process.env["ID"], 10) Commented Apr 30, 2021 at 18:25
  • @Emanuele I try it but it doesn't work Commented Apr 30, 2021 at 18:35
  • 1
    Can you elaborate on what does not work? Commented Apr 30, 2021 at 18:39

1 Answer 1

12

You can do it by one of the following methods

1) parseInt(process.env.ID, 10); 2) Number(process.env.ID); 3) +process.env.ID; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.