Deno is a modern runtime for JavaScript and TypeScript. It lets you run code outside the browser, like Node.js, but with better security and built-in tools.
Click to reveal answer
intermediate
How does Deno improve security compared to Node.js?
Deno runs code in a secure sandbox by default. It blocks file, network, and environment access unless you explicitly allow it with flags.
Click to reveal answer
beginner
Which languages does Deno support natively?
Deno supports JavaScript and TypeScript out of the box, so you can run both without extra setup.
Click to reveal answer
intermediate
Name one built-in tool that comes with Deno.
Deno includes a built-in code formatter, a test runner, and a bundler, so you don't need extra tools for these tasks.
Click to reveal answer
intermediate
Why was Deno created?
Deno was created by the same person who made Node.js to fix some design problems and add modern features like security and TypeScript support.
Click to reveal answer
What is the main purpose of Deno?
ADesign websites
BCreate mobile apps
CRun JavaScript and TypeScript outside the browser
DManage databases
✗ Incorrect
Deno is a runtime to run JavaScript and TypeScript code outside the browser environment.
Which language does Deno support without extra setup?
APython
BC++
CRuby
DJavaScript
✗ Incorrect
Deno supports JavaScript and TypeScript natively.
How does Deno handle security by default?
ABlocks all access unless allowed
BRequires a password
CAllows all access
DRuns code in the browser
✗ Incorrect
Deno runs code in a secure sandbox and blocks file, network, and environment access unless explicitly allowed.
Who created Deno?
ABrendan Eich
BRyan Dahl
CGuido van Rossum
DLinus Torvalds
✗ Incorrect
Ryan Dahl created Deno as a modern alternative to Node.js.
Which of these is a built-in tool in Deno?
ACode formatter
BDatabase manager
CImage editor
DWeb browser
✗ Incorrect
Deno includes a built-in code formatter among other tools.
Explain what Deno is and why it was created.
Think about what problems Deno solves compared to Node.js.
You got /4 concepts.
Describe how Deno handles security differently from other runtimes.
Focus on what happens when you run code without special permissions.
You got /3 concepts.
Practice
(1/5)
1. What is Deno primarily used for?
easy
A. Running JavaScript and TypeScript outside the browser
B. Creating mobile apps
C. Designing websites with HTML and CSS
D. Managing databases
Solution
Step 1: Understand Deno's purpose
Deno is a runtime environment that allows running JavaScript and TypeScript code outside of web browsers.
Step 2: Compare options with Deno's use
Options A, B, and D describe other technologies or tasks unrelated to Deno's main function.
Final Answer:
Running JavaScript and TypeScript outside the browser -> Option A
Quick Check:
Deno runs JS/TS outside browser = C [OK]
Hint: Deno runs JS/TS outside browser, not for apps or design [OK]
Common Mistakes:
Confusing Deno with frontend frameworks
Thinking Deno manages databases
Assuming Deno is for mobile app development
2. Which command correctly runs a Deno script named app.ts?
easy
A. deno execute app.ts
B. deno start app.ts
C. node app.ts
D. deno run app.ts
Solution
Step 1: Recall Deno's run command
Deno uses the command deno run to execute scripts.
Step 2: Check other options
deno execute app.ts uses 'execute' which is invalid, deno start app.ts uses 'start' which is not a Deno command, node app.ts uses 'node' which is for Node.js.
Final Answer:
deno run app.ts -> Option D
Quick Check:
Run scripts with 'deno run' = D [OK]
Hint: Use 'deno run' to execute scripts, not 'execute' or 'start' [OK]
Common Mistakes:
Using 'node' instead of 'deno run'
Typing 'deno execute' instead of 'deno run'
Trying 'deno start' which is invalid
3. What will happen if you run deno run --allow-net app.ts?
medium
A. The script runs with permission to access the network
B. The script runs without any permissions
C. The script will fail due to missing permissions
D. The script runs with permission to access the file system
Solution
Step 1: Understand the permission flag
The flag --allow-net grants the script permission to access network resources.
Step 2: Analyze the command effect
Since the flag is present, the script can use network features. Other permissions like file system access are not granted.
Final Answer:
The script runs with permission to access the network -> Option A
Quick Check:
--allow-net grants network access = A [OK]
Hint: Flags like --allow-net control permissions; here network is allowed [OK]
Common Mistakes:
Assuming no permissions are given without --allow-all
Confusing network permission with file system permission
Thinking script fails without --allow-net
4. Identify the error in this command: deno run --allow-read app.ts when app.ts tries to access the network.
medium
A. No error, network access is allowed by default
B. Error because --allow-read does not allow network access
C. Error because --allow-read is an invalid flag
D. No error, script runs with all permissions
Solution
Step 1: Understand permission flags
The flag --allow-read only allows file system read access, not network access.
Step 2: Analyze script behavior
If app.ts tries to access the network without --allow-net, it will cause a permission error.
Final Answer:
Error because --allow-read does not allow network access -> Option B
Quick Check:
--allow-read ≠ network permission = B [OK]
Hint: Network needs --allow-net; --allow-read is only for files [OK]
Common Mistakes:
Assuming --allow-read grants network access
Thinking all permissions are granted by default
Using invalid flags
5. You want to run a Deno script server.ts that reads files and accesses the network securely. Which command should you use?
hard
A. deno run server.ts
B. deno run --allow-all server.ts
C. deno run --allow-net --allow-read server.ts
D. deno run --allow-write server.ts
Solution
Step 1: Identify required permissions
The script needs to read files and access the network, so it requires --allow-read and --allow-net.
Step 2: Evaluate options for security
deno run --allow-net --allow-read server.ts grants only needed permissions. deno run --allow-all server.ts grants all permissions, which is less secure. deno run server.ts grants none. deno run --allow-write server.ts grants write access, which is unnecessary.
Final Answer:
deno run --allow-net --allow-read server.ts -> Option C
Quick Check:
Grant only needed permissions for security = A [OK]
Hint: Grant only needed permissions, avoid --allow-all for safety [OK]
Common Mistakes:
Using --allow-all which is less secure
Forgetting to add --allow-net for network access
Adding unnecessary permissions like --allow-write
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.