I have an array set up like the following:
var array = [["A1", "left:81px"], ["A2", "left:145px"],...]
The purpose of this is to take a user input and search through this array to find the location to move an element to. If the user input is "A1" how can I parse through this array to set some variable equal to "left:81px"?
mapis a bad recommendation for this problem ...mapperforms an operation on every element of the input array and produces a new output array. that has nothing to do with the question being asked - we don't want to perform an operation on every element and we don't want to create a new array.