0

I want to run the following function: doStuff(objName.variable, variable);

The object objName has a property that the variable variable is equal too.

How would I make this work where instead of trying to find the property variable of objName, the code tries to find the property of objName that is stored in variable.

Thanks.

J Doe
  • 1
  • Include a sample of your object please. – Korgrue Jun 19 '17 at 21:05
  • Maybe some code would give context to your question, but as it stands, it is very hard to determine what you are actually trying to do. – light Jun 19 '17 at 21:07
  • I personally have no clue what you are trying to do with that description. Maybe code sample with that you are trying to do would help. – epascarello Jun 19 '17 at 21:07
  • Do you mean, `objName[variableContainingPropertyName]` ? – James Jun 19 '17 at 21:07
  • I could guess and assume this is what you're trying to do: https://jsfiddle.net/38rnbzst/ but I think we need more of a context or sample code to really understand what you're looking for. Do you want to see if an object contains a variable, e.g. object has key named "test1", and the variable = "test1", or are you trying to see if a object's key e.g object.key = value - has a value of the variable "test1", etc. – Woodrow Jun 19 '17 at 21:12
  • @James Yeah, thanks. – J Doe Jun 19 '17 at 21:13

0 Answers0