user1658435
user1658435

Reputation: 574

Getting Undefined stored into array

I'm trying to run the following codeenter image description here

I would like to store the contents of the log file into user defined array. How can I do that. Please help me out. Thanks in advance

Upvotes: 0

Views: 45

Answers (1)

Vengarioth
Vengarioth

Reputation: 684

console.log(); has no return type, split the statement in your loop into 2 statements.

console.log(elements[i].innerHTML);
price[i] = elements[i].innerHTML;

Upvotes: 5

Related Questions