I've two arrays in javascript code. I want to use element of the array x as index for the array y.
You can see I've numbers in the array x, so is there any possible and easy way I can do it.
<script>
var x = [1,2,3,4,6]
var y = ["kin","kim","jong","ving","gon","von","rick"]
</script>
like
y+x[4] //(not a code just for idea)
must print "rick".
I tried
y+x[4] //I know that's stupid
but its not working. Please provide answer in javascript.
y[x[4]]