Skip to main content
Node.js Code Completion Medium +20 XP

Environment Variable

Complete the environment variable access.

Node.jsFill in the blank
const port = process.___PORT || 3000;

Type the missing code

Show answer and explanation

Answer: env.

process.env is an object containing all environment variables. process.env.PORT reads the PORT variable.

Hint: Where are environment variables in Node?

What this challenge tests

Code Completion in Node.js: env, configuration.

Related challenges