Files

23 lines
490 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Use the .env File
---
# Use the .env File
2018-10-12 15:37:13 -04:00
---
## Problem Explanation
2018-10-12 15:37:13 -04:00
We can use the .toUpperCase() method to make a string all caps, such as:
```javascript
var response = "Hello World".toUpperCase(); // now becomes "HELLO WORLD"
2018-10-12 15:37:13 -04:00
```
All we need to do now is check what the value of the environment variable is, which you can do like:
```javascript
if (process.env.VAR_NAME === "allCaps") {
response = "Hello World".toUpperCase();
} else {
response = "Hello World";
}
2018-10-12 15:37:13 -04:00
```