## Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today. # What am I doing wrong to convert this?

For this project I need to convert every string value in the numarr array to a number, but my parseInt method isn't working. Can anyone see what my problem is?

```<html>
<body>
<script>

let body = document.getElementsByTagName('body');
let input = document.getElementsByTagName('input');
let button = document.getElementsByTagName('button');
let ul = document.getElementsByTagName('ul');

let numarr;
let numbers;
let counter = 0;
let valid = true;
let funct;
let text;
let li;

function program() {

numbers = input.value;
numarr = numbers.split(' ');

for (let z = 0; z < numarr.length; z ++) {

parseInt(numarr[z]);

if (isNaN(numarr[z])) {

valid = false;
break;
}

}

if (valid === true) {
sum();
}

else {
}

function sum() {

for (let a = 0; a < numarr.length; a ++) {

for (let b = a + 1; b < numarr.length; b ++) {

for (let c = b + 1; c < numarr.length; c ++) {

if (numarr[a] + numarr[b] + numarr[c] === 0) {

text = document.createTextNode(numarr[a] + ", " + numarr[b] + ", " + numarr[c]);
li = document.createElement('li');
li.appendChild(text);
ul.appendChild(li);

text = undefined;
li = undefined;
}
}
}
}
}
}
program();
});

body.style.backgroundColor = 'violet';
body.style.color = 'yellow';

input.style.backgroundColor = 'lightgray';
});

input.style.backgroundColor = 'white';
});

button.style.backgroundColor = 'tomato';
button.style.color = 'orange';
button.style.border = 'tomato';

button.style.backgroundColor = 'orange';
button.style.color = 'tomato';
});

button.style.backgroundColor = 'tomato';
button.style.color = 'orange';
});
};

</script>
</body>
</html>
``` Use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. Or watch this video on code formatting. This code is referring to elements with tags like "input", "button" and "ul"; but there's nothing in the body except for the script itself.

Also, "parseInt" doesn't change its argument, it returns a number result. To make use of that result you would need to assign it to a variable or pass it as an argument to a function.

So you're saying to get the number I'm looking for, I have to assign the parsed values to a variable or pass them to a function? (Just want to be clear) For example, if you wanted to change the the value in the variable from a string to a number:

```        numarr[z] = parseInt(numarr[z]);
```

Calling "parseInt" by itself performs the conversion but does not change anything.