curriculum/challenges/english/blocks/learn-functional-programming-by-building-a-spreadsheet/642dfb07e7fa6736251541c8.md
Your array will need to be the size of the range. You can calculate this by finding the difference between end and start, and adding 1 to the result.
Pass this calculation as the argument for your Array() constructor.
You should subtract start from end.
assert.match(code, /end\s*-\s*start/);
You should add 1 to your end - start calculation.
assert.match(code, /end\s*-\s*start\s*\+\s*1/);
You should pass your calculation to the Array() constructor.
assert.match(code, /const\s+range\s*=\s*\(\s*start\s*,\s*end\s*\)\s*=>\s*Array\(\s*end\s*-\s*start\s*\+\s*1\s*\)/);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="./styles.css" />
<title>Functional Programming Spreadsheet</title>
</head>
<body>
<div id="container">
<div></div>
</div>
<script src="./script.js"></script>
</body>
</html>
#container {
display: grid;
grid-template-columns: 50px repeat(10, 200px);
grid-template-rows: repeat(11, 30px);
}
.label {
background-color: lightgray;
text-align: center;
vertical-align: middle;
line-height: 30px;
}
--fcc-editable-region--
const range = (start, end) => Array();
--fcc-editable-region--
window.onload = () => {
const container = document.getElementById("container");
const createLabel = (name) => {
const label = document.createElement("div");
label.className = "label";
label.textContent = name;
container.appendChild(label);
}
}