Status: Not Started
  • scratchpad.js
  • Unit Test
Font Size
14
Parentheses autocomplete
Wrap lines
Editor
Theme
Code with blocks by default
Auto-Format
Console Font Size
12
Console Theme
Show File Tab Bar
Code Running Environment

Use the newest vesion of the JavaScript library.

Treasure Chest Choice
Unit Test
function openChest(chestColor) {
// Your code here
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Grading
Docs
Exercise
More
 
Pass Test Message

Errors:

This student is viewing this assignment in English. View this page in English?

5 points

Write a function openChest that takes one parameter: chestColor (a string). If chestColor is 'gold', return 'You found a mountain of coins!'. If chestColor is 'silver', return 'You discovered rare gems!'. If chestColor is 'wooden', return 'You got some old scrolls!'. For any other color, return 'The chest is empty...'.

Reset Code

Slides and Notes

No slides available for this video

About

JavaScript (function)