L
L
lavezzi12018-03-29 08:09:36
JavaScript
lavezzi1, 2018-03-29 08:09:36

Why is the value overwritten by the last iteration in a recursive traversal?

Here is an example https://jsfiddle.net/x4gyg9qp/ ideally you want the first value displayed in the console.
I expected that on the contrary, by the end of the line will be filled with all the titles.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2018-03-29
@lavezzi1

Because when you recursively call, nothing is returned back.
https://jsfiddle.net/x4gyg9qp/10/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question