i want to get the element at particular position from this array.
Is there any function to achieve this ?
i want something which behaves like ArrayList.get() function in java.
My requirements are such that I can't use cars[0], cars[1] etc
Is there any inbuilt function to do so ?
Rob
Nope... that is how you access arrays in javascript, what makes you think otherwise? What are you trying to do that makes you have to try and access an array like this?
console.log(cars[0]); // outputs "BMW"
console.log(cars[1]); // outputs "Mercedes"
console.log(cars[2]); // outputs "Audi"
my article touches on some of this stuff: https://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_13138-Javascript-is-just-an-Object.html