Is it possible in JavaScript to initialize an array in, for example, subindex 1?
GenderArray: ['Female', 'Male', 'Other'],
I want the Female to be 1, Male to be 2 and Other to be 3.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just put in a dummy:
If you need an arbitrary position in the array use
splice()as in:Which will put them in starting at position 4.