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' 

}
1
  • 3
    levelProgress[key]. Commented Mar 9, 2018 at 21:52

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.