Challenge - 5 Problems
Deno Beginner Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of a simple Deno script
What will be the output when running this Deno script?
Deno
console.log("Hello from Deno!");Attempts:
2 left
💡 Hint
Think about what console.log does in JavaScript and Deno.
✗ Incorrect
The console.log function prints the string to the console. So the output is exactly the string inside the quotes.
📝 Syntax
intermediateIdentify the syntax error in a Deno script
Which option contains a syntax error when running in Deno?
Deno
console.log("Welcome to Deno") console.log('Enjoy coding!')
Attempts:
2 left
💡 Hint
Look carefully at the punctuation marks in each line.
✗ Incorrect
Option B has a missing closing parenthesis before the semicolon, causing a syntax error.
❓ component_behavior
advancedBehavior of Deno script with async function
What will be the output of this Deno script?
Deno
async function greet() { return "Hello, Deno!"; } greet().then(console.log);
Attempts:
2 left
💡 Hint
Remember that .then() waits for the promise to resolve and passes the result.
✗ Incorrect
The async function returns a promise that resolves to the string. The .then(console.log) prints the resolved value.
🔧 Debug
advancedIdentify the runtime error in this Deno script
Which option will cause a runtime error when running this Deno script?
Deno
console.log(message);
const message = "Deno is awesome!";Attempts:
2 left
💡 Hint
Think about variable hoisting and when variables are available.
✗ Incorrect
The variable 'message' is declared with const after it is used, causing a ReferenceError at runtime.
🧠 Conceptual
expertUnderstanding Deno permissions
What happens if you run a Deno script that tries to read a file without the proper permission flag?
Deno
import { readTextFile } from "https://deno.land/std/fs/mod.ts"; const content = await readTextFile("./data.txt"); console.log(content);
Attempts:
2 left
💡 Hint
Deno requires explicit permission for file system access.
✗ Incorrect
Deno enforces security by requiring permission flags like --allow-read to access files. Without it, it throws a PermissionDenied error.
