Answer the question
In order to leave comments, you need to log in
How to trim an array to a specific number of elements?
I have an array with an unknown number of elements. I need to have up to 5 elements in the array, how to do it? Only through for?
Answer the question
In order to leave comments, you need to log in
https://developer.mozilla.org/en/docs/Web/JavaScript...arr.slice([begin[, end]]) // вернет новый массив
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question