/    Sign up×
Community /Pin to ProfileBookmark

Basic Questions About Arrays

Hi everybody.

I have a question about the arrays:

Is there a function or a way to know the lenght or the dimmension of an array??? I really need to know.

I supose that I can use a variable to control the number of elements as I add them to it, but I’d prefer to use something like array.lenght or lenght(array), or like in VBScript:
UBound(array).

If someone knows… please help me!!! I’m quite new in JavaScripts.

CybIRO

?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisFeb 16.2004 — All arrays have a length attribute free of charge.
var myAry = new Array("one","two","three","four");
alert(myAry.length); // should say 4
As to dimension, arrays are one dimension. However that does not prevent you from making each element an array also. It is not the same as BASIC where you have to dimension an array first.
Copy linkTweet thisAlerts:
@96turnerriFeb 16.2004 — arrayname.length would work fine

//gil beat me too it :mad:
Copy linkTweet thisAlerts:
@CybIROauthorFeb 16.2004 — Thank You very Much

? It is working fine!
×

Success!

Help @CybIRO spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...