Question: I do not understand why after clicking the link "undefined" is shown. Does anyone know why?

```js
let allBlocks = ["one","two"];

for (i = 0; i < allBlocks.length; i++) {
  document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>';
}

function test(n){
    alert(n);
}

```

Answer: 
Maybe what you need is string interpolation

```
for (i = 0; i < allBlocks.length; i++) {

  document.body.innerHTML += `<p id="" onclick="test(${allBlocks[i]})">Link</p>`;

}

function test(n){
    alert(n);
}

```

This will pass the value of `allblocks[i]` instead of just a string
..because `allBlocks[i]` is undefined. You need the value of `i` to be rendered in your HTML. 

```js
let allBlocks = ["one","two"];

for (i = 0; i < allBlocks.length; i++) {

  document.body.innerHTML += '<p id="" onclick="test(allBlocks['+i+'])">Link</p>';

}

function test(n){
    alert(n);
}
```