Using a variable to search an array instead of a static string
===

Okay, so what I have is basically three dynamic drop down boxes and a 2D array. I have each box adding their values together, and then I want the sum of the values to be searched for through the array to pull out the fifth value on whatever the row the value was on.
    
    var shape = document.getElementById("shape").value;
	var dimension_one = document.getElementById("dimension_One").value;
	var x = 'x';
	var dimension_two = document.getElementById("dimension_Two").value;
	var selected_beam = shape + dimension_one + x + dimension_two; // combine all values from text boxes 
	alert(selected_beam);
	
	


	for (i = 0; i < array_shapes.length; i++)
	{
		     
				if (array_shapes[i][2] == selected_beam) {
					alert('Area=' + array_shapes[i][5]);
					//Area= array_shapes[i][5]);
					
				}
			}
I know that selected _beam is giving me the value I want, and I also know that the array loop returns what I want out of the array but only if I replace 

     if (array_shapes[i][2] == selected_beam)
with

    if (array_shapes[i][2] == "value I want to search for")
    
So what I really need to know is - why will it only accept it as a string and not as my selected_beam variable.