You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Howdy! I'm trying to write some patterns for a buddy's cube, and I've written something to help me test locally, but I'm still unsure of language limitations.
I see that array literals aren't permitted, but does array.length exist?
Can arrays be of variable size at all?
When you create a new array with array(10), what are the initial values of that array?
The text was updated successfully, but these errors were encountered:
pavellishin
changed the title
More clarity in docs?
Can arrays be dynamically sized?
Sep 25, 2019
pavellishin
changed the title
Can arrays be dynamically sized?
Question about arrays
Sep 25, 2019
The language is es6 in syntax, but a limited subset of functionality is supported. Currently there is no object support, which rules out things like array.length and constructors. Thats why the way to allocate an array is different. I suppose I should have made a function like arrayLength(array).
Arrays, once created, are of fixed length. They work more like primitive arrays in other languages, though they can store elements of any value including functions or other arrays. Accessing an element outside of the bounds of an array will abort the current function and show an error in the editor and highlight the line responsible, but rendering will continue (the show must go on!).
Arrays are initialized with zeros.
BTW, this would be a good thing to ask in the forum!
Howdy! I'm trying to write some patterns for a buddy's cube, and I've written something to help me test locally, but I'm still unsure of language limitations.
I see that array literals aren't permitted, but does
array.length
exist?Can arrays be of variable size at all?
When you create a new array with
array(10)
, what are the initial values of that array?The text was updated successfully, but these errors were encountered: