Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyNodeJSprocess.env variablesSingle-choice MCQ

A teammate logs process.env.PORT and is surprised it prints 3000 (a number in their .env) as the string "3000". Why, and what is the safe fix to use it as a number?

// .env contains: PORT=3000 const port = process.env.PORT; console.log(typeof port); // ? const server = app.listen(port);