const array = [2, 5, 9]; let squares = []; for (let i = 0; i < array.length; i++) { squares.push(array[i] * array[i])); } console.log(squares); // [4, 25, 81] console.log(array); // [2, 5, 9]
On this code block you say that it: " ...finds the square of each element in the array..."
It would be more accurate to say that the relevant part of the code calculates (as opposed to finding) the square root of each element in the array.
Of course by the find, i think you meant "calculate" but then again, why not use the word calculate instead?
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
On this code block you say that it: " ...finds the square of each element in the array..."
It would be more accurate to say that the relevant part of the code calculates (as opposed to finding) the square root of each element in the array.
Of course by the find, i think you meant "calculate" but then again, why not use the word calculate instead?