Logo

Programming-Idioms

History of Idiom 205 > diff from v26 to v27

Edit summary for version 27 by cfbender:
New JS implementation by user [cfbender]

Version 26

2020-06-08, 22:10:08

Version 27

2020-06-10, 04:32:30

Idiom #205 Get an environment variable

Read an environment variable with the name "FOO" and assign it to the string variable foo. If it does not exist or if the system does not support environment variables, assign a value of "none".

Idiom #205 Get an environment variable

Read an environment variable with the name "FOO" and assign it to the string variable foo. If it does not exist or if the system does not support environment variables, assign a value of "none".

Variables
foo
Variables
foo
Extra Keywords
envvar os system
Extra Keywords
envvar os system
Code
const foo = process.env["FOO"] || "none";