1

I want to call a dynamic value using parameter. Parameter is working fine as expected but I am not able to call.

function calculatePoint(key){
    console.log(key); //working fine
    var required_points = levelProgress.key - anualPoints; // levelProgress.key returns undefined.
    return required_points;
}

Note: levelProgress is an object that has values

var levelProgress={
'director':'20000',
'star':'5000',
'cast':'1000',
'crew':'100',
'fan':'0' 

}
Santosh
  • 3,477
  • 5
  • 37
  • 75

0 Answers0