javascript - value of an object from a variable -
this question has answer here:
i getting object looks this
discount = {salesman: 0, supervisor: 0.02, manager: 0.05}; group_name = 'salesman';
i need value of discount.group_name if group_name = 'salesman' should 0, if group_name = manager should 0.05 , on.
i tried doing
console.log(discount.group_name)
but didn't work.
please me.
Comments
Post a Comment