mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-07 06:02:06 -04:00
1.2 KiB
1.2 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 62a3a7e4f1060e2fc5ffb34b | الخطوة 9 | 0 | step-9 |
--description--
Create another variable called currentWeapon and set it to 0.
When a variable name has multiple words, the convention in JavaScript is to use what's called camelCase. The first word is lowercase, and the first letter of every following word is uppercase.
let thisIsCamelCase;
--hints--
You should use let to declare a variable called currentWeapon.
assert.match(code, /let\s+currentWeapon/i);
You should use camelCase to name your variable.
assert.match(code, /currentWeapon/);
Your currentWeapon variable should be set to 0.
assert.equal(currentWeapon, 0);
You should initialize your variable to 0.
assert.match(code, /let\s+currentWeapon\s*=\s*0/);
--seed--
--seed-contents--
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="./styles.css">
<title>RPG - Dragon Repeller</title>
<script src="./script.js"></script>
</head>
<body>
<div id="game">
</div>
</body>
</html>
--fcc-editable-region--
let xp = 0;
let health = 100;
let gold = 50;
--fcc-editable-region--