meaning const countArray = [ ]
and as a result countArray.push(n)
should result [5]
so my question is :
why did it result in [1,2,3,4,5] and how did it happened?
please I need a clear explanation because maybe how I was thought was wrong
**Your code so far**
// Only change code below this line
function countdown(n){
return;
}
// Only change code above this line
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Hi, take a look at my thread and the solution I have marked in
I had the same confusion, but the lessons to that point if I re call correctly don’t teach us about data structure yet, the solution answers that question fairly.