+ 1
can someone explane me arr??? pls
5 Answers
+ 4
@Bagshot: the question is tagged with 'javascript' not 'java' ^^
@Ivica:
You're probably refering to a code example using a variable named 'arr' to store an array (list of values)...
In JS, you can declare array by two main ways:
var arr = new Array(); // explicit creation of Array object
... or:
var arr = [ ]; // literal notation, implicit Array object created
+ 2
Do you mean "arrr, I hit my toe!"? Or arr as in array?
An array is just a collection of strings, intergers, floats, etc. You can access each element of the array using its index number.
int[] arr = { 5, 4, 3, 2, 1};
string[] arr = {"sololearn", "is", "cool"};
It doesn't have to be called arr, by the way.
+ 2
Ok, my mistake. It's actually c#, but yeah should have read it better.
+ 1
Tnx
+ 1
Tnx