Compare
Websites
Templates
Store
Pricing
Docs
Blog
Log in
Sign up
How to
How it works
API reference
File types
sjs-4
sjs-4e
accept-2
accept-3
app-1
contextmenu-1
css-1
css-2
css-2-wrapper
html-1
image-1
markdown-1
redirect-301
sh-1
static-1
svg-1
deprecated types
accept-1
sjs-3
Injected variables
Collection
add
attrInt32
attrStr
each
eq
filter
first
inline
last
length
query
reverse
select
slice
sort
sortBy
File
os
User
util
File links
App interface
Hotkeys & mouse controls
HTML classes
Filesystem Query Language
Reserved namespaces
Filesystem interface versions
Glossary
WARNING: The [sjs-3] engine was
deprecated
, use [
sjs-4
] instead.
Collection.length
Return the number of files in the collection.
Syntax
collection.length int
Examples
Empty collection
c = new Collection() os.print(c.length)
Run
Non-empty collection.
f1 = new File() f2 = new File() c = new Collection(f1, f2) os.print(c.length)
Run