for (var i = 0, f; f = file[i]; i++) This code is responsible for displaying the number of files, now it can output at least 100 or 200 files without restrictions, but what needs to be changed in it so that it displays no more than 10 files?
for (var i = 0, f; f = file[i]; i++) This code is responsible for displaying the number of files, now it can output at least 100 or 200 files without restrictions, but what needs to be changed in it so that it displays no more than 10 files?
for (var i = 0, f; i < 10 && f = file[i]; i++) And even better - do it humanly.
var cnt = Math.min(10, file.length); for (var i = 0, i < cnt; i++) { var f = file[i]; ....... } min can still? :) - teranfile ? Is it an array or some object? How do you get it? - Anton ShchyrovSource: https://ru.stackoverflow.com/questions/798655/
All Articles