Complete the code to access an environment variable named 'API_KEY' in Deno.
const apiKey = Deno.env.[1]('API_KEY');
Use Deno.env.get() to read environment variables in Deno.
Complete the code to safely access an environment variable 'DATABASE_URL' with a fallback value.
const dbUrl = Deno.env.get('DATABASE_URL') || [1];
Provide a fallback string URL if the environment variable is not set.
Fix the error in the code to set an environment variable 'PORT' before running the server.
Deno.env.[1]('PORT', '8080');
Use Deno.env.set() to set environment variables in Deno.
Fill both blanks to check if the environment variable 'DEBUG' is set to 'true' (string) and log accordingly.
if (Deno.env.get('DEBUG') [1] 'true') { console.[2]('Debug mode is ON'); }
Use strict equality === to compare strings and console.log to print messages.
Fill all three blanks to create a config object with port number from env, fallback to 3000, and parse it as a number.
const config = {
port: Number(Deno.env.[1]('PORT') || [2]),
env: Deno.env.[3]('ENVIRONMENT') || 'development'
};Use Deno.env.get() to read variables, fallback port to 3000, and fallback environment to 'development'.
