Just to be painfully anal, there is no such thing as O(10*n). Constants disappear in Big-O notation as it is only concerned with growth rates and limiting behavior, not the actual time taken for a certain operation. i.e. your example it is still O(n).
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.
The author fixed it, but the code used to be something like:
The
console.log
statement is executedarr.length * 10
times. That's a complexity of O(10* n), n being the size of thearr
array.Just to be painfully anal, there is no such thing as O(10*n). Constants disappear in Big-O notation as it is only concerned with growth rates and limiting behavior, not the actual time taken for a certain operation. i.e. your example it is still O(n).